
/*
本代码自动生成 请不要修改
如果手动修改 再次生成的时候 可能会覆盖您的修改
生成的时间是 2010-10-15 13:52:22

实体类，类名规则：数据表名前加"C" 
类的字段命名规则是: a_ + 字段名称
类的方法命名规则是：F_ 开头
 
生成工具: 华光代码生成


*/

using System;
using System.Collections;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;
using HGZP.PLL;
namespace HGZP.DAL
{


    static public partial class ReplaceString
    {
        static public string GetReplaceString(string SqlString)
        {
            SqlString = SqlString.Replace("'", "''").Replace("--", "");
            return SqlString;
        }
    }
    //部门( Base_Department )  
    /// <summary>
    /// 部门
    /// </summary>
    public partial class Sql_Base_Department
    {
        #region 与数据表(部门)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 层级 
        /// </summary> 
        public System.Int32? a_iDepth = null;
        /// <summary> 
        /// 父级ID 
        /// </summary> 
        public System.String a_sGuidParent = null;
        /// <summary> 
        /// 业务部门 
        /// </summary> 
        public System.Boolean? a_bEmployeeDepartment = null;
        /// <summary> 
        /// 公关部门 
        /// </summary> 
        public System.Boolean? a_bPublicRelationsDepartment = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sGuidParent != null) { this.a_sGuidParent = ReplaceString.GetReplaceString(this.a_sGuidParent); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Base_Department( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_iDepth != null) { mySqlScript += "iDepth,"; }
            if (this.a_sGuidParent != null) { mySqlScript += "sGuidParent,"; }
            if (this.a_bEmployeeDepartment != null) { mySqlScript += "bEmployeeDepartment,"; }
            if (this.a_bPublicRelationsDepartment != null) { mySqlScript += "bPublicRelationsDepartment,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_iDepth != null) { mySqlScript += this.a_iDepth + ","; }
            if (this.a_sGuidParent != null) { mySqlScript += "'" + this.a_sGuidParent + "',"; }
            if (this.a_bEmployeeDepartment != null) { mySqlScript += "'" + this.a_bEmployeeDepartment + "',"; }
            if (this.a_bPublicRelationsDepartment != null) { mySqlScript += "'" + this.a_bPublicRelationsDepartment + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Base_Department set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_iDepth != null) { iColumnCount++; mySqlScript += " iDepth = " + this.a_iDepth + ","; }
            if (this.a_sGuidParent != null) { iColumnCount++; mySqlScript += " sGuidParent = '" + this.a_sGuidParent + "',"; }
            if (this.a_bEmployeeDepartment != null) { iColumnCount++; mySqlScript += " bEmployeeDepartment = '" + this.a_bEmployeeDepartment + "',"; }
            if (this.a_bPublicRelationsDepartment != null) { iColumnCount++; mySqlScript += " bPublicRelationsDepartment = '" + this.a_bPublicRelationsDepartment + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Base_Department Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //人员( Base_Department_Person )  
    /// <summary>
    /// 人员
    /// </summary>
    public partial class Sql_Base_Department_Person
    {
        #region 与数据表(人员)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 部门ID 
        /// </summary> 
        public System.String a_sGuidBase_Department = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 姓名 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 是业务员 
        /// </summary> 
        public System.Boolean? a_bEmployee = null;
        /// <summary> 
        /// 是公关人 
        /// </summary> 
        public System.Boolean? a_bPublicRelations = null;
        /// <summary> 
        /// 是中介人 
        /// </summary> 
        public System.Boolean? a_bIntermediary = null;
        /// <summary> 
        /// 是优惠人 
        /// </summary> 
        public System.Boolean? a_bDiscount = null;
        /// <summary> 
        /// 是承包人 
        /// </summary> 
        public System.Boolean? a_bContract = null;
        /// <summary> 
        /// 是编辑 
        /// </summary> 
        public System.Boolean? a_bEdit = null;
        /// <summary> 
        /// 是操作员 
        /// </summary> 
        public System.Boolean? a_bOperator = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department != null) { this.a_sGuidBase_Department = ReplaceString.GetReplaceString(this.a_sGuidBase_Department); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Base_Department_Person( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBase_Department != null) { mySqlScript += "sGuidBase_Department,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bEmployee != null) { mySqlScript += "bEmployee,"; }
            if (this.a_bPublicRelations != null) { mySqlScript += "bPublicRelations,"; }
            if (this.a_bIntermediary != null) { mySqlScript += "bIntermediary,"; }
            if (this.a_bDiscount != null) { mySqlScript += "bDiscount,"; }
            if (this.a_bContract != null) { mySqlScript += "bContract,"; }
            if (this.a_bEdit != null) { mySqlScript += "bEdit,"; }
            if (this.a_bOperator != null) { mySqlScript += "bOperator,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBase_Department != null) { mySqlScript += "'" + this.a_sGuidBase_Department + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bEmployee != null) { mySqlScript += "'" + this.a_bEmployee + "',"; }
            if (this.a_bPublicRelations != null) { mySqlScript += "'" + this.a_bPublicRelations + "',"; }
            if (this.a_bIntermediary != null) { mySqlScript += "'" + this.a_bIntermediary + "',"; }
            if (this.a_bDiscount != null) { mySqlScript += "'" + this.a_bDiscount + "',"; }
            if (this.a_bContract != null) { mySqlScript += "'" + this.a_bContract + "',"; }
            if (this.a_bEdit != null) { mySqlScript += "'" + this.a_bEdit + "',"; }
            if (this.a_bOperator != null) { mySqlScript += "'" + this.a_bOperator + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Base_Department_Person set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBase_Department != null) { iColumnCount++; mySqlScript += " sGuidBase_Department = '" + this.a_sGuidBase_Department + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bEmployee != null) { iColumnCount++; mySqlScript += " bEmployee = '" + this.a_bEmployee + "',"; }
            if (this.a_bPublicRelations != null) { iColumnCount++; mySqlScript += " bPublicRelations = '" + this.a_bPublicRelations + "',"; }
            if (this.a_bIntermediary != null) { iColumnCount++; mySqlScript += " bIntermediary = '" + this.a_bIntermediary + "',"; }
            if (this.a_bDiscount != null) { iColumnCount++; mySqlScript += " bDiscount = '" + this.a_bDiscount + "',"; }
            if (this.a_bContract != null) { iColumnCount++; mySqlScript += " bContract = '" + this.a_bContract + "',"; }
            if (this.a_bEdit != null) { iColumnCount++; mySqlScript += " bEdit = '" + this.a_bEdit + "',"; }
            if (this.a_bOperator != null) { iColumnCount++; mySqlScript += " bOperator = '" + this.a_bOperator + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Base_Department_Person Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //业务员折扣( Base_Department_Person_EmployeeDiscount )  
    /// <summary>
    /// 业务员折扣
    /// </summary>
    public partial class Sql_Base_Department_Person_EmployeeDiscount
    {
        #region 与数据表(业务员折扣)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 优先级 
        /// </summary> 
        public System.Int32? a_iPriority = null;
        /// <summary> 
        /// 折扣名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 媒体ID 
        /// </summary> 
        public System.String a_sGuidBaseMedia = null;
        /// <summary> 
        /// 媒体 
        /// </summary> 
        public System.String a_sNameBaseMedia = null;
        /// <summary> 
        /// 色彩ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Color = null;
        /// <summary> 
        /// 色彩 
        /// </summary> 
        public System.String a_sNameBasePrice_Color = null;
        /// <summary> 
        /// 行业1级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_1 = null;
        /// <summary> 
        /// 行业1级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_1 = null;
        /// <summary> 
        /// 行业2级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_2 = null;
        /// <summary> 
        /// 行业2级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_2 = null;
        /// <summary> 
        /// 行业3级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_3 = null;
        /// <summary> 
        /// 行业3级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_3 = null;
        /// <summary> 
        /// 客户/代理/全部 
        /// </summary> 
        public System.String a_sCustomers_Agent = null;
        /// <summary> 
        /// 星期ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Week = null;
        /// <summary> 
        /// 星期 
        /// </summary> 
        public System.String a_sNameBasePrice_Week = null;
        /// <summary> 
        /// 版位类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 版位类别 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 广告类型ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_AdvertisingType = null;
        /// <summary> 
        /// 广告类型 
        /// </summary> 
        public System.String a_sNameBaseOrder_AdvertisingType = null;
        /// <summary> 
        /// 长单类型ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_LongOrderType = null;
        /// <summary> 
        /// 长单类型 
        /// </summary> 
        public System.String a_sNameBaseOrder_LongOrderType = null;
        /// <summary> 
        /// 折扣率 
        /// </summary> 
        public System.Double? a_nDiscount = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sGuidBaseMedia != null) { this.a_sGuidBaseMedia = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia); }
            if (this.a_sNameBaseMedia != null) { this.a_sNameBaseMedia = ReplaceString.GetReplaceString(this.a_sNameBaseMedia); }
            if (this.a_sGuidBasePrice_Color != null) { this.a_sGuidBasePrice_Color = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Color); }
            if (this.a_sNameBasePrice_Color != null) { this.a_sNameBasePrice_Color = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Color); }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { this.a_sGuidBaseOrder_Industry_1 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_1); }
            if (this.a_sNameBaseOrder_Industry_1 != null) { this.a_sNameBaseOrder_Industry_1 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_1); }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { this.a_sGuidBaseOrder_Industry_2 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_2); }
            if (this.a_sNameBaseOrder_Industry_2 != null) { this.a_sNameBaseOrder_Industry_2 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_2); }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { this.a_sGuidBaseOrder_Industry_3 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_3); }
            if (this.a_sNameBaseOrder_Industry_3 != null) { this.a_sNameBaseOrder_Industry_3 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_3); }
            if (this.a_sCustomers_Agent != null) { this.a_sCustomers_Agent = ReplaceString.GetReplaceString(this.a_sCustomers_Agent); }
            if (this.a_sGuidBasePrice_Week != null) { this.a_sGuidBasePrice_Week = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Week); }
            if (this.a_sNameBasePrice_Week != null) { this.a_sNameBasePrice_Week = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Week); }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { this.a_sGuidBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_PagePositionType); }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { this.a_sNameBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_PagePositionType); }
            if (this.a_sGuidBaseOrder_AdvertisingType != null) { this.a_sGuidBaseOrder_AdvertisingType = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_AdvertisingType); }
            if (this.a_sNameBaseOrder_AdvertisingType != null) { this.a_sNameBaseOrder_AdvertisingType = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_AdvertisingType); }
            if (this.a_sGuidBaseOrder_LongOrderType != null) { this.a_sGuidBaseOrder_LongOrderType = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_LongOrderType); }
            if (this.a_sNameBaseOrder_LongOrderType != null) { this.a_sNameBaseOrder_LongOrderType = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_LongOrderType); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Base_Department_Person_EmployeeDiscount( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iPriority != null) { mySqlScript += "iPriority,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "sGuidBaseMedia,"; }
            if (this.a_sNameBaseMedia != null) { mySqlScript += "sNameBaseMedia,"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "sGuidBasePrice_Color,"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "sNameBasePrice_Color,"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { mySqlScript += "sGuidBaseOrder_Industry_1,"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { mySqlScript += "sNameBaseOrder_Industry_1,"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { mySqlScript += "sGuidBaseOrder_Industry_2,"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { mySqlScript += "sNameBaseOrder_Industry_2,"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { mySqlScript += "sGuidBaseOrder_Industry_3,"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { mySqlScript += "sNameBaseOrder_Industry_3,"; }
            if (this.a_sCustomers_Agent != null) { mySqlScript += "sCustomers_Agent,"; }
            if (this.a_sGuidBasePrice_Week != null) { mySqlScript += "sGuidBasePrice_Week,"; }
            if (this.a_sNameBasePrice_Week != null) { mySqlScript += "sNameBasePrice_Week,"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "sGuidBasePrice_Media_PagePositionType,"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "sNameBasePrice_Media_PagePositionType,"; }
            if (this.a_sGuidBaseOrder_AdvertisingType != null) { mySqlScript += "sGuidBaseOrder_AdvertisingType,"; }
            if (this.a_sNameBaseOrder_AdvertisingType != null) { mySqlScript += "sNameBaseOrder_AdvertisingType,"; }
            if (this.a_sGuidBaseOrder_LongOrderType != null) { mySqlScript += "sGuidBaseOrder_LongOrderType,"; }
            if (this.a_sNameBaseOrder_LongOrderType != null) { mySqlScript += "sNameBaseOrder_LongOrderType,"; }
            if (this.a_nDiscount != null) { mySqlScript += "nDiscount,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iPriority != null) { mySqlScript += this.a_iPriority + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "'" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_sNameBaseMedia != null) { mySqlScript += "'" + this.a_sNameBaseMedia + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "'" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_1 + "',"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_1 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_2 + "',"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_2 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_3 + "',"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_3 + "',"; }
            if (this.a_sCustomers_Agent != null) { mySqlScript += "'" + this.a_sCustomers_Agent + "',"; }
            if (this.a_sGuidBasePrice_Week != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Week + "',"; }
            if (this.a_sNameBasePrice_Week != null) { mySqlScript += "'" + this.a_sNameBasePrice_Week + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBaseOrder_AdvertisingType != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_AdvertisingType + "',"; }
            if (this.a_sNameBaseOrder_AdvertisingType != null) { mySqlScript += "'" + this.a_sNameBaseOrder_AdvertisingType + "',"; }
            if (this.a_sGuidBaseOrder_LongOrderType != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_LongOrderType + "',"; }
            if (this.a_sNameBaseOrder_LongOrderType != null) { mySqlScript += "'" + this.a_sNameBaseOrder_LongOrderType + "',"; }
            if (this.a_nDiscount != null) { mySqlScript += this.a_nDiscount + ","; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Base_Department_Person_EmployeeDiscount set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iPriority != null) { iColumnCount++; mySqlScript += " iPriority = " + this.a_iPriority + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sGuidBaseMedia != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia = '" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_sNameBaseMedia != null) { iColumnCount++; mySqlScript += " sNameBaseMedia = '" + this.a_sNameBaseMedia + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Color = '" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Color = '" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_1 = '" + this.a_sGuidBaseOrder_Industry_1 + "',"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_1 = '" + this.a_sNameBaseOrder_Industry_1 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_2 = '" + this.a_sGuidBaseOrder_Industry_2 + "',"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_2 = '" + this.a_sNameBaseOrder_Industry_2 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_3 = '" + this.a_sGuidBaseOrder_Industry_3 + "',"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_3 = '" + this.a_sNameBaseOrder_Industry_3 + "',"; }
            if (this.a_sCustomers_Agent != null) { iColumnCount++; mySqlScript += " sCustomers_Agent = '" + this.a_sCustomers_Agent + "',"; }
            if (this.a_sGuidBasePrice_Week != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Week = '" + this.a_sGuidBasePrice_Week + "',"; }
            if (this.a_sNameBasePrice_Week != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Week = '" + this.a_sNameBasePrice_Week + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_PagePositionType = '" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_PagePositionType = '" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBaseOrder_AdvertisingType != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_AdvertisingType = '" + this.a_sGuidBaseOrder_AdvertisingType + "',"; }
            if (this.a_sNameBaseOrder_AdvertisingType != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_AdvertisingType = '" + this.a_sNameBaseOrder_AdvertisingType + "',"; }
            if (this.a_sGuidBaseOrder_LongOrderType != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_LongOrderType = '" + this.a_sGuidBaseOrder_LongOrderType + "',"; }
            if (this.a_sNameBaseOrder_LongOrderType != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_LongOrderType = '" + this.a_sNameBaseOrder_LongOrderType + "',"; }
            if (this.a_nDiscount != null) { iColumnCount++; mySqlScript += " nDiscount = " + this.a_nDiscount + ","; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Base_Department_Person_EmployeeDiscount Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //操作员权限( Base_Department_Person_OperatorMan )  
    /// <summary>
    /// 操作员权限
    /// </summary>
    public partial class Sql_Base_Department_Person_OperatorMan
    {
        #region 与数据表(操作员权限)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 人员Guid 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 登录名 
        /// </summary> 
        public System.String a_sUserID = null;
        /// <summary> 
        /// 口令 
        /// </summary> 
        public System.String a_sPassWord = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sUserID != null) { this.a_sUserID = ReplaceString.GetReplaceString(this.a_sUserID); }
            if (this.a_sPassWord != null) { this.a_sPassWord = ReplaceString.GetReplaceString(this.a_sPassWord); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Base_Department_Person_OperatorMan( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sUserID != null) { mySqlScript += "sUserID,"; }
            if (this.a_sPassWord != null) { mySqlScript += "sPassWord,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sUserID != null) { mySqlScript += "'" + this.a_sUserID + "',"; }
            if (this.a_sPassWord != null) { mySqlScript += "'" + this.a_sPassWord + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Base_Department_Person_OperatorMan set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sUserID != null) { iColumnCount++; mySqlScript += " sUserID = '" + this.a_sUserID + "',"; }
            if (this.a_sPassWord != null) { iColumnCount++; mySqlScript += " sPassWord = '" + this.a_sPassWord + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Base_Department_Person_OperatorMan Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //操作员工作时间限制( Base_Department_Person_OperatorOperatorMan_Limit )  
    /// <summary>
    /// 操作员工作时间限制
    /// </summary>
    public partial class Sql_Base_Department_Person_OperatorOperatorMan_Limit
    {
        #region 与数据表(操作员工作时间限制)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Base_Department_Person_OperatorOperatorMan_Limit( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Base_Department_Person_OperatorOperatorMan_Limit set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Base_Department_Person_OperatorOperatorMan_Limit Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //操作员其它权限( Base_Department_Person_OperatorOperatorMan_OtherPermissions )  
    /// <summary>
    /// 操作员其它权限
    /// </summary>
    public partial class Sql_Base_Department_Person_OperatorOperatorMan_OtherPermissions
    {
        #region 与数据表(操作员其它权限)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// ID 
        /// </summary> 
        public System.String a_sID = null;
        /// <summary> 
        /// 数值 
        /// </summary> 
        public System.String a_sValue = null;
        /// <summary> 
        /// 描述 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sID != null) { this.a_sID = ReplaceString.GetReplaceString(this.a_sID); }
            if (this.a_sValue != null) { this.a_sValue = ReplaceString.GetReplaceString(this.a_sValue); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Base_Department_Person_OperatorOperatorMan_OtherPermissions( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sID != null) { mySqlScript += "sID,"; }
            if (this.a_sValue != null) { mySqlScript += "sValue,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sID != null) { mySqlScript += "'" + this.a_sID + "',"; }
            if (this.a_sValue != null) { mySqlScript += "'" + this.a_sValue + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Base_Department_Person_OperatorOperatorMan_OtherPermissions set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sID != null) { iColumnCount++; mySqlScript += " sID = '" + this.a_sID + "',"; }
            if (this.a_sValue != null) { iColumnCount++; mySqlScript += " sValue = '" + this.a_sValue + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Base_Department_Person_OperatorOperatorMan_OtherPermissions Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //审批流程( BaseApprovalProcess )  
    /// <summary>
    /// 审批流程
    /// </summary>
    public partial class Sql_BaseApprovalProcess
    {
        #region 与数据表(审批流程)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 操作类型(广告订单/改判归属/客户挂牌/客户摘牌/预开发票/广告改刊/广告停刊/广告加刊/广告退款/工作报告/广告折扣/客户返回金/刊后付款) 
        /// </summary> 
        public System.String a_sFlagType = null;
        /// <summary> 
        /// 执行条件 
        /// </summary> 
        public System.String a_sExecuteCondition = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sFlagType != null) { this.a_sFlagType = ReplaceString.GetReplaceString(this.a_sFlagType); }
            if (this.a_sExecuteCondition != null) { this.a_sExecuteCondition = ReplaceString.GetReplaceString(this.a_sExecuteCondition); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseApprovalProcess( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sFlagType != null) { mySqlScript += "sFlagType,"; }
            if (this.a_sExecuteCondition != null) { mySqlScript += "sExecuteCondition,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sFlagType != null) { mySqlScript += "'" + this.a_sFlagType + "',"; }
            if (this.a_sExecuteCondition != null) { mySqlScript += "'" + this.a_sExecuteCondition + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseApprovalProcess set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sFlagType != null) { iColumnCount++; mySqlScript += " sFlagType = '" + this.a_sFlagType + "',"; }
            if (this.a_sExecuteCondition != null) { iColumnCount++; mySqlScript += " sExecuteCondition = '" + this.a_sExecuteCondition + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseApprovalProcess Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //审批流程步骤( BaseApprovalProcess_Step )  
    /// <summary>
    /// 审批流程步骤
    /// </summary>
    public partial class Sql_BaseApprovalProcess_Step
    {
        #region 与数据表(审批流程步骤)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 审批流程 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 步骤名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 审批人列表(更加详细的在BaseApprovalProcess_Step_Person中) 
        /// </summary> 
        public System.String a_sApproverList = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sApproverList != null) { this.a_sApproverList = ReplaceString.GetReplaceString(this.a_sApproverList); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseApprovalProcess_Step( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sApproverList != null) { mySqlScript += "sApproverList,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sApproverList != null) { mySqlScript += "'" + this.a_sApproverList + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseApprovalProcess_Step set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sApproverList != null) { iColumnCount++; mySqlScript += " sApproverList = '" + this.a_sApproverList + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseApprovalProcess_Step Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //审批流程步骤_人员( BaseApprovalProcess_Step_Person )  
    /// <summary>
    /// 审批流程步骤_人员
    /// </summary>
    public partial class Sql_BaseApprovalProcess_Step_Person
    {
        #region 与数据表(审批流程步骤_人员)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 审批步骤 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess_Step = null;
        /// <summary> 
        /// 审批人ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 审批人 
        /// </summary> 
        public System.String a_sNameBase_Department_Person = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseApprovalProcess_Step != null) { this.a_sGuidBaseApprovalProcess_Step = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess_Step); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sNameBase_Department_Person != null) { this.a_sNameBase_Department_Person = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseApprovalProcess_Step_Person( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sGuidBaseApprovalProcess_Step != null) { mySqlScript += "sGuidBaseApprovalProcess_Step,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "sNameBase_Department_Person,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sGuidBaseApprovalProcess_Step != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess_Step + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseApprovalProcess_Step_Person set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sGuidBaseApprovalProcess_Step != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess_Step = '" + this.a_sGuidBaseApprovalProcess_Step + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person = '" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseApprovalProcess_Step_Person Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //佣金政策(业务员)( BaseCommision_Policy_Employee )  
    /// <summary>
    /// 佣金政策(业务员)
    /// </summary>
    public partial class Sql_BaseCommision_Policy_Employee
    {
        #region 与数据表(佣金政策(业务员))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 政策名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 默认 
        /// </summary> 
        public System.Boolean? a_bDefault = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCommision_Policy_Employee( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bDefault != null) { mySqlScript += "bDefault,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bDefault != null) { mySqlScript += "'" + this.a_bDefault + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCommision_Policy_Employee set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bDefault != null) { iColumnCount++; mySqlScript += " bDefault = '" + this.a_bDefault + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCommision_Policy_Employee Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //佣金影响因素设置(业务员)( BaseCommision_Policy_Employee_AffectFactor )  
    /// <summary>
    /// 佣金影响因素设置(业务员)
    /// </summary>
    public partial class Sql_BaseCommision_Policy_Employee_AffectFactor
    {
        #region 与数据表(佣金影响因素设置(业务员))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 佣金政策ID 
        /// </summary> 
        public System.String a_sGuidBaseCommision_Policy_Employee = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 优先级(数字小的在前面) 
        /// </summary> 
        public System.Int32? a_iPriority = null;
        /// <summary> 
        /// 内容类别 
        /// </summary> 
        public System.Boolean? a_bBasePrice_ContentType = null;
        /// <summary> 
        /// 是否和部门相关 
        /// </summary> 
        public System.Boolean? a_bBase_Department = null;
        /// <summary> 
        /// 是否和业务员相关 
        /// </summary> 
        public System.Boolean? a_bBase_Department_Person_Employee = null;
        /// <summary> 
        /// 是否和版位类别相关 
        /// </summary> 
        public System.Boolean? a_bBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 是否和颜色相关 
        /// </summary> 
        public System.Boolean? a_bBasePrice_Color = null;
        /// <summary> 
        /// 是否和规格相关 
        /// </summary> 
        public System.Boolean? a_bBasePrice_Media_Specification = null;
        /// <summary> 
        /// 是否和业绩段相关 
        /// </summary> 
        public System.Boolean? a_bAchievementSection = null;
        /// <summary> 
        /// 是否和折扣下点相关 
        /// </summary> 
        public System.Boolean? a_bDiscountDown = null;
        /// <summary> 
        /// 是否和行业相关 
        /// </summary> 
        public System.Boolean? a_bBaseOrder_Industry = null;
        /// <summary> 
        /// 是否和地区相关 
        /// </summary> 
        public System.Boolean? a_bBaseOrder_Region = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { this.a_sGuidBaseCommision_Policy_Employee = ReplaceString.GetReplaceString(this.a_sGuidBaseCommision_Policy_Employee); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCommision_Policy_Employee_AffectFactor( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { mySqlScript += "sGuidBaseCommision_Policy_Employee,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iPriority != null) { mySqlScript += "iPriority,"; }
            if (this.a_bBasePrice_ContentType != null) { mySqlScript += "bBasePrice_ContentType,"; }
            if (this.a_bBase_Department != null) { mySqlScript += "bBase_Department,"; }
            if (this.a_bBase_Department_Person_Employee != null) { mySqlScript += "bBase_Department_Person_Employee,"; }
            if (this.a_bBasePrice_Media_PagePositionType != null) { mySqlScript += "bBasePrice_Media_PagePositionType,"; }
            if (this.a_bBasePrice_Color != null) { mySqlScript += "bBasePrice_Color,"; }
            if (this.a_bBasePrice_Media_Specification != null) { mySqlScript += "bBasePrice_Media_Specification,"; }
            if (this.a_bAchievementSection != null) { mySqlScript += "bAchievementSection,"; }
            if (this.a_bDiscountDown != null) { mySqlScript += "bDiscountDown,"; }
            if (this.a_bBaseOrder_Industry != null) { mySqlScript += "bBaseOrder_Industry,"; }
            if (this.a_bBaseOrder_Region != null) { mySqlScript += "bBaseOrder_Region,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { mySqlScript += "'" + this.a_sGuidBaseCommision_Policy_Employee + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iPriority != null) { mySqlScript += this.a_iPriority + ","; }
            if (this.a_bBasePrice_ContentType != null) { mySqlScript += "'" + this.a_bBasePrice_ContentType + "',"; }
            if (this.a_bBase_Department != null) { mySqlScript += "'" + this.a_bBase_Department + "',"; }
            if (this.a_bBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_bBase_Department_Person_Employee + "',"; }
            if (this.a_bBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_bBasePrice_Media_PagePositionType + "',"; }
            if (this.a_bBasePrice_Color != null) { mySqlScript += "'" + this.a_bBasePrice_Color + "',"; }
            if (this.a_bBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_bBasePrice_Media_Specification + "',"; }
            if (this.a_bAchievementSection != null) { mySqlScript += "'" + this.a_bAchievementSection + "',"; }
            if (this.a_bDiscountDown != null) { mySqlScript += "'" + this.a_bDiscountDown + "',"; }
            if (this.a_bBaseOrder_Industry != null) { mySqlScript += "'" + this.a_bBaseOrder_Industry + "',"; }
            if (this.a_bBaseOrder_Region != null) { mySqlScript += "'" + this.a_bBaseOrder_Region + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCommision_Policy_Employee_AffectFactor set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { iColumnCount++; mySqlScript += " sGuidBaseCommision_Policy_Employee = '" + this.a_sGuidBaseCommision_Policy_Employee + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iPriority != null) { iColumnCount++; mySqlScript += " iPriority = " + this.a_iPriority + ","; }
            if (this.a_bBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " bBasePrice_ContentType = '" + this.a_bBasePrice_ContentType + "',"; }
            if (this.a_bBase_Department != null) { iColumnCount++; mySqlScript += " bBase_Department = '" + this.a_bBase_Department + "',"; }
            if (this.a_bBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " bBase_Department_Person_Employee = '" + this.a_bBase_Department_Person_Employee + "',"; }
            if (this.a_bBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " bBasePrice_Media_PagePositionType = '" + this.a_bBasePrice_Media_PagePositionType + "',"; }
            if (this.a_bBasePrice_Color != null) { iColumnCount++; mySqlScript += " bBasePrice_Color = '" + this.a_bBasePrice_Color + "',"; }
            if (this.a_bBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " bBasePrice_Media_Specification = '" + this.a_bBasePrice_Media_Specification + "',"; }
            if (this.a_bAchievementSection != null) { iColumnCount++; mySqlScript += " bAchievementSection = '" + this.a_bAchievementSection + "',"; }
            if (this.a_bDiscountDown != null) { iColumnCount++; mySqlScript += " bDiscountDown = '" + this.a_bDiscountDown + "',"; }
            if (this.a_bBaseOrder_Industry != null) { iColumnCount++; mySqlScript += " bBaseOrder_Industry = '" + this.a_bBaseOrder_Industry + "',"; }
            if (this.a_bBaseOrder_Region != null) { iColumnCount++; mySqlScript += " bBaseOrder_Region = '" + this.a_bBaseOrder_Region + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCommision_Policy_Employee_AffectFactor Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //佣金折扣下点设置(业务员)( BaseCommision_Policy_Employee_DiscountDown )  
    /// <summary>
    /// 佣金折扣下点设置(业务员)
    /// </summary>
    public partial class Sql_BaseCommision_Policy_Employee_DiscountDown
    {
        #region 与数据表(佣金折扣下点设置(业务员))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 佣金政策(业务员) 
        /// </summary> 
        public System.String a_sGuidBaseCommision_Policy_Employee = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 开始折扣 
        /// </summary> 
        public System.Double? a_nDiscount_Start = null;
        /// <summary> 
        /// 结束折扣 
        /// </summary> 
        public System.Double? a_nDiscount_End = null;
        /// <summary> 
        /// 下点比例 
        /// </summary> 
        public System.Double? a_nDownPercentage = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { this.a_sGuidBaseCommision_Policy_Employee = ReplaceString.GetReplaceString(this.a_sGuidBaseCommision_Policy_Employee); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCommision_Policy_Employee_DiscountDown( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { mySqlScript += "sGuidBaseCommision_Policy_Employee,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_nDiscount_Start != null) { mySqlScript += "nDiscount_Start,"; }
            if (this.a_nDiscount_End != null) { mySqlScript += "nDiscount_End,"; }
            if (this.a_nDownPercentage != null) { mySqlScript += "nDownPercentage,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { mySqlScript += "'" + this.a_sGuidBaseCommision_Policy_Employee + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_nDiscount_Start != null) { mySqlScript += this.a_nDiscount_Start + ","; }
            if (this.a_nDiscount_End != null) { mySqlScript += this.a_nDiscount_End + ","; }
            if (this.a_nDownPercentage != null) { mySqlScript += this.a_nDownPercentage + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCommision_Policy_Employee_DiscountDown set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { iColumnCount++; mySqlScript += " sGuidBaseCommision_Policy_Employee = '" + this.a_sGuidBaseCommision_Policy_Employee + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_nDiscount_Start != null) { iColumnCount++; mySqlScript += " nDiscount_Start = " + this.a_nDiscount_Start + ","; }
            if (this.a_nDiscount_End != null) { iColumnCount++; mySqlScript += " nDiscount_End = " + this.a_nDiscount_End + ","; }
            if (this.a_nDownPercentage != null) { iColumnCount++; mySqlScript += " nDownPercentage = " + this.a_nDownPercentage + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCommision_Policy_Employee_DiscountDown Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //佣金比例设置(业务员)( BaseCommision_Policy_Employee_Percentage )  
    /// <summary>
    /// 佣金比例设置(业务员)
    /// </summary>
    public partial class Sql_BaseCommision_Policy_Employee_Percentage
    {
        #region 与数据表(佣金比例设置(业务员))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 佣金政策(业务员) 
        /// </summary> 
        public System.String a_sGuidBaseCommision_Policy_Employee = null;
        /// <summary> 
        /// 内容类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_ContentType = null;
        /// <summary> 
        /// 内容类别 
        /// </summary> 
        public System.String a_sNameBasePrice_ContentType = null;
        /// <summary> 
        /// 部门1级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_1 = null;
        /// <summary> 
        /// 部门2级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_2 = null;
        /// <summary> 
        /// 部门3级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_3 = null;
        /// <summary> 
        /// 部门1级 
        /// </summary> 
        public System.String a_sNameBase_Department_1 = null;
        /// <summary> 
        /// 部门2级 
        /// </summary> 
        public System.String a_sNameBase_Department_2 = null;
        /// <summary> 
        /// 部门3级 
        /// </summary> 
        public System.String a_sNameBase_Department_3 = null;
        /// <summary> 
        /// 业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 业务员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person = null;
        /// <summary> 
        /// 广告规格ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_Specification = null;
        /// <summary> 
        /// 广告规格 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_Specification = null;
        /// <summary> 
        /// 版位类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 版位类别 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 色彩ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Color = null;
        /// <summary> 
        /// 色彩 
        /// </summary> 
        public System.String a_sNameBasePrice_Color = null;
        /// <summary> 
        /// 行业1级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_1 = null;
        /// <summary> 
        /// 行业2级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_2 = null;
        /// <summary> 
        /// 行业3级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_3 = null;
        /// <summary> 
        /// 行业1级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_1 = null;
        /// <summary> 
        /// 行业2级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_2 = null;
        /// <summary> 
        /// 行业3级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_3 = null;
        /// <summary> 
        /// 业绩段_开始 
        /// </summary> 
        public System.Double? a_nAchievementSection_Start = null;
        /// <summary> 
        /// 业绩段_结束 
        /// </summary> 
        public System.Double? a_nAchievementSection_End = null;
        /// <summary> 
        /// 地区ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Region = null;
        /// <summary> 
        /// 地区 
        /// </summary> 
        public System.String a_sNameBaseOrder_Region = null;
        /// <summary> 
        /// 佣金比例 
        /// </summary> 
        public System.Double? a_nPercentage = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { this.a_sGuidBaseCommision_Policy_Employee = ReplaceString.GetReplaceString(this.a_sGuidBaseCommision_Policy_Employee); }
            if (this.a_sGuidBasePrice_ContentType != null) { this.a_sGuidBasePrice_ContentType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_ContentType); }
            if (this.a_sNameBasePrice_ContentType != null) { this.a_sNameBasePrice_ContentType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_ContentType); }
            if (this.a_sGuidBase_Department_1 != null) { this.a_sGuidBase_Department_1 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_1); }
            if (this.a_sGuidBase_Department_2 != null) { this.a_sGuidBase_Department_2 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_2); }
            if (this.a_sGuidBase_Department_3 != null) { this.a_sGuidBase_Department_3 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_3); }
            if (this.a_sNameBase_Department_1 != null) { this.a_sNameBase_Department_1 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_1); }
            if (this.a_sNameBase_Department_2 != null) { this.a_sNameBase_Department_2 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_2); }
            if (this.a_sNameBase_Department_3 != null) { this.a_sNameBase_Department_3 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_3); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sNameBase_Department_Person != null) { this.a_sNameBase_Department_Person = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person); }
            if (this.a_sGuidBasePrice_Media_Specification != null) { this.a_sGuidBasePrice_Media_Specification = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_Specification); }
            if (this.a_sNameBasePrice_Media_Specification != null) { this.a_sNameBasePrice_Media_Specification = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_Specification); }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { this.a_sGuidBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_PagePositionType); }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { this.a_sNameBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_PagePositionType); }
            if (this.a_sGuidBasePrice_Color != null) { this.a_sGuidBasePrice_Color = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Color); }
            if (this.a_sNameBasePrice_Color != null) { this.a_sNameBasePrice_Color = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Color); }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { this.a_sGuidBaseOrder_Industry_1 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_1); }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { this.a_sGuidBaseOrder_Industry_2 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_2); }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { this.a_sGuidBaseOrder_Industry_3 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_3); }
            if (this.a_sNameBaseOrder_Industry_1 != null) { this.a_sNameBaseOrder_Industry_1 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_1); }
            if (this.a_sNameBaseOrder_Industry_2 != null) { this.a_sNameBaseOrder_Industry_2 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_2); }
            if (this.a_sNameBaseOrder_Industry_3 != null) { this.a_sNameBaseOrder_Industry_3 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_3); }
            if (this.a_sGuidBaseOrder_Region != null) { this.a_sGuidBaseOrder_Region = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Region); }
            if (this.a_sNameBaseOrder_Region != null) { this.a_sNameBaseOrder_Region = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Region); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCommision_Policy_Employee_Percentage( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { mySqlScript += "sGuidBaseCommision_Policy_Employee,"; }
            if (this.a_sGuidBasePrice_ContentType != null) { mySqlScript += "sGuidBasePrice_ContentType,"; }
            if (this.a_sNameBasePrice_ContentType != null) { mySqlScript += "sNameBasePrice_ContentType,"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "sGuidBase_Department_1,"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "sGuidBase_Department_2,"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "sGuidBase_Department_3,"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "sNameBase_Department_1,"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "sNameBase_Department_2,"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "sNameBase_Department_3,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "sNameBase_Department_Person,"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { mySqlScript += "sGuidBasePrice_Media_Specification,"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { mySqlScript += "sNameBasePrice_Media_Specification,"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "sGuidBasePrice_Media_PagePositionType,"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "sNameBasePrice_Media_PagePositionType,"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "sGuidBasePrice_Color,"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "sNameBasePrice_Color,"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { mySqlScript += "sGuidBaseOrder_Industry_1,"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { mySqlScript += "sGuidBaseOrder_Industry_2,"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { mySqlScript += "sGuidBaseOrder_Industry_3,"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { mySqlScript += "sNameBaseOrder_Industry_1,"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { mySqlScript += "sNameBaseOrder_Industry_2,"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { mySqlScript += "sNameBaseOrder_Industry_3,"; }
            if (this.a_nAchievementSection_Start != null) { mySqlScript += "nAchievementSection_Start,"; }
            if (this.a_nAchievementSection_End != null) { mySqlScript += "nAchievementSection_End,"; }
            if (this.a_sGuidBaseOrder_Region != null) { mySqlScript += "sGuidBaseOrder_Region,"; }
            if (this.a_sNameBaseOrder_Region != null) { mySqlScript += "sNameBaseOrder_Region,"; }
            if (this.a_nPercentage != null) { mySqlScript += "nPercentage,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { mySqlScript += "'" + this.a_sGuidBaseCommision_Policy_Employee + "',"; }
            if (this.a_sGuidBasePrice_ContentType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_ContentType + "',"; }
            if (this.a_sNameBasePrice_ContentType != null) { mySqlScript += "'" + this.a_sNameBasePrice_ContentType + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "'" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "'" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "'" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_Specification + "',"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_Specification + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "'" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_1 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_2 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_3 + "',"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_1 + "',"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_2 + "',"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_3 + "',"; }
            if (this.a_nAchievementSection_Start != null) { mySqlScript += this.a_nAchievementSection_Start + ","; }
            if (this.a_nAchievementSection_End != null) { mySqlScript += this.a_nAchievementSection_End + ","; }
            if (this.a_sGuidBaseOrder_Region != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Region + "',"; }
            if (this.a_sNameBaseOrder_Region != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Region + "',"; }
            if (this.a_nPercentage != null) { mySqlScript += this.a_nPercentage + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCommision_Policy_Employee_Percentage set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { iColumnCount++; mySqlScript += " sGuidBaseCommision_Policy_Employee = '" + this.a_sGuidBaseCommision_Policy_Employee + "',"; }
            if (this.a_sGuidBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_ContentType = '" + this.a_sGuidBasePrice_ContentType + "',"; }
            if (this.a_sNameBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_ContentType = '" + this.a_sNameBasePrice_ContentType + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_1 = '" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_2 = '" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_3 = '" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_sNameBase_Department_1 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_1 = '" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_2 = '" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_3 = '" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person = '" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_Specification = '" + this.a_sGuidBasePrice_Media_Specification + "',"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_Specification = '" + this.a_sNameBasePrice_Media_Specification + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_PagePositionType = '" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_PagePositionType = '" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Color = '" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Color = '" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_1 = '" + this.a_sGuidBaseOrder_Industry_1 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_2 = '" + this.a_sGuidBaseOrder_Industry_2 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_3 = '" + this.a_sGuidBaseOrder_Industry_3 + "',"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_1 = '" + this.a_sNameBaseOrder_Industry_1 + "',"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_2 = '" + this.a_sNameBaseOrder_Industry_2 + "',"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_3 = '" + this.a_sNameBaseOrder_Industry_3 + "',"; }
            if (this.a_nAchievementSection_Start != null) { iColumnCount++; mySqlScript += " nAchievementSection_Start = " + this.a_nAchievementSection_Start + ","; }
            if (this.a_nAchievementSection_End != null) { iColumnCount++; mySqlScript += " nAchievementSection_End = " + this.a_nAchievementSection_End + ","; }
            if (this.a_sGuidBaseOrder_Region != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Region = '" + this.a_sGuidBaseOrder_Region + "',"; }
            if (this.a_sNameBaseOrder_Region != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Region = '" + this.a_sNameBaseOrder_Region + "',"; }
            if (this.a_nPercentage != null) { iColumnCount++; mySqlScript += " nPercentage = " + this.a_nPercentage + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCommision_Policy_Employee_Percentage Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //佣金政策(公关人)( BaseCommision_Policy_PublicRelations )  
    /// <summary>
    /// 佣金政策(公关人)
    /// </summary>
    public partial class Sql_BaseCommision_Policy_PublicRelations
    {
        #region 与数据表(佣金政策(公关人))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 政策名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 默认 
        /// </summary> 
        public System.Boolean? a_bDefault = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCommision_Policy_PublicRelations( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bDefault != null) { mySqlScript += "bDefault,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bDefault != null) { mySqlScript += "'" + this.a_bDefault + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCommision_Policy_PublicRelations set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bDefault != null) { iColumnCount++; mySqlScript += " bDefault = '" + this.a_bDefault + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCommision_Policy_PublicRelations Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //佣金影响因素设置(公关人)( BaseCommision_Policy_PublicRelations_AffectFactor )  
    /// <summary>
    /// 佣金影响因素设置(公关人)
    /// </summary>
    public partial class Sql_BaseCommision_Policy_PublicRelations_AffectFactor
    {
        #region 与数据表(佣金影响因素设置(公关人))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 佣金政策ID 
        /// </summary> 
        public System.String a_sGuidBaseCommision_Policy_PublicRelations = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 优先级(数字小的在前面) 
        /// </summary> 
        public System.Int32? a_iPriority = null;
        /// <summary> 
        /// 内容类别 
        /// </summary> 
        public System.Boolean? a_bBasePrice_ContentType = null;
        /// <summary> 
        /// 是否和部门相关 
        /// </summary> 
        public System.Boolean? a_bBase_Department = null;
        /// <summary> 
        /// 是否和业务员相关 
        /// </summary> 
        public System.Boolean? a_bBase_Department_Person_Employee = null;
        /// <summary> 
        /// 是否和版位类别相关 
        /// </summary> 
        public System.Boolean? a_bBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 是否和颜色相关 
        /// </summary> 
        public System.Boolean? a_bBasePrice_Color = null;
        /// <summary> 
        /// 是否和规格相关 
        /// </summary> 
        public System.Boolean? a_bBasePrice_Media_Specification = null;
        /// <summary> 
        /// 是否和折扣下点相关 
        /// </summary> 
        public System.Boolean? a_bDiscountDown = null;
        /// <summary> 
        /// 是否和行业相关 
        /// </summary> 
        public System.Boolean? a_bBaseOrder_Industry = null;
        /// <summary> 
        /// 是否和地区相关 
        /// </summary> 
        public System.Boolean? a_bBaseOrder_Region = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { this.a_sGuidBaseCommision_Policy_PublicRelations = ReplaceString.GetReplaceString(this.a_sGuidBaseCommision_Policy_PublicRelations); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCommision_Policy_PublicRelations_AffectFactor( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { mySqlScript += "sGuidBaseCommision_Policy_PublicRelations,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iPriority != null) { mySqlScript += "iPriority,"; }
            if (this.a_bBasePrice_ContentType != null) { mySqlScript += "bBasePrice_ContentType,"; }
            if (this.a_bBase_Department != null) { mySqlScript += "bBase_Department,"; }
            if (this.a_bBase_Department_Person_Employee != null) { mySqlScript += "bBase_Department_Person_Employee,"; }
            if (this.a_bBasePrice_Media_PagePositionType != null) { mySqlScript += "bBasePrice_Media_PagePositionType,"; }
            if (this.a_bBasePrice_Color != null) { mySqlScript += "bBasePrice_Color,"; }
            if (this.a_bBasePrice_Media_Specification != null) { mySqlScript += "bBasePrice_Media_Specification,"; }
            if (this.a_bDiscountDown != null) { mySqlScript += "bDiscountDown,"; }
            if (this.a_bBaseOrder_Industry != null) { mySqlScript += "bBaseOrder_Industry,"; }
            if (this.a_bBaseOrder_Region != null) { mySqlScript += "bBaseOrder_Region,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { mySqlScript += "'" + this.a_sGuidBaseCommision_Policy_PublicRelations + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iPriority != null) { mySqlScript += this.a_iPriority + ","; }
            if (this.a_bBasePrice_ContentType != null) { mySqlScript += "'" + this.a_bBasePrice_ContentType + "',"; }
            if (this.a_bBase_Department != null) { mySqlScript += "'" + this.a_bBase_Department + "',"; }
            if (this.a_bBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_bBase_Department_Person_Employee + "',"; }
            if (this.a_bBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_bBasePrice_Media_PagePositionType + "',"; }
            if (this.a_bBasePrice_Color != null) { mySqlScript += "'" + this.a_bBasePrice_Color + "',"; }
            if (this.a_bBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_bBasePrice_Media_Specification + "',"; }
            if (this.a_bDiscountDown != null) { mySqlScript += "'" + this.a_bDiscountDown + "',"; }
            if (this.a_bBaseOrder_Industry != null) { mySqlScript += "'" + this.a_bBaseOrder_Industry + "',"; }
            if (this.a_bBaseOrder_Region != null) { mySqlScript += "'" + this.a_bBaseOrder_Region + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCommision_Policy_PublicRelations_AffectFactor set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { iColumnCount++; mySqlScript += " sGuidBaseCommision_Policy_PublicRelations = '" + this.a_sGuidBaseCommision_Policy_PublicRelations + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iPriority != null) { iColumnCount++; mySqlScript += " iPriority = " + this.a_iPriority + ","; }
            if (this.a_bBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " bBasePrice_ContentType = '" + this.a_bBasePrice_ContentType + "',"; }
            if (this.a_bBase_Department != null) { iColumnCount++; mySqlScript += " bBase_Department = '" + this.a_bBase_Department + "',"; }
            if (this.a_bBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " bBase_Department_Person_Employee = '" + this.a_bBase_Department_Person_Employee + "',"; }
            if (this.a_bBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " bBasePrice_Media_PagePositionType = '" + this.a_bBasePrice_Media_PagePositionType + "',"; }
            if (this.a_bBasePrice_Color != null) { iColumnCount++; mySqlScript += " bBasePrice_Color = '" + this.a_bBasePrice_Color + "',"; }
            if (this.a_bBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " bBasePrice_Media_Specification = '" + this.a_bBasePrice_Media_Specification + "',"; }
            if (this.a_bDiscountDown != null) { iColumnCount++; mySqlScript += " bDiscountDown = '" + this.a_bDiscountDown + "',"; }
            if (this.a_bBaseOrder_Industry != null) { iColumnCount++; mySqlScript += " bBaseOrder_Industry = '" + this.a_bBaseOrder_Industry + "',"; }
            if (this.a_bBaseOrder_Region != null) { iColumnCount++; mySqlScript += " bBaseOrder_Region = '" + this.a_bBaseOrder_Region + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCommision_Policy_PublicRelations_AffectFactor Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //佣金折扣下点设置(公关人)( BaseCommision_Policy_PublicRelations_DiscountDown )  
    /// <summary>
    /// 佣金折扣下点设置(公关人)
    /// </summary>
    public partial class Sql_BaseCommision_Policy_PublicRelations_DiscountDown
    {
        #region 与数据表(佣金折扣下点设置(公关人))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 佣金政策(公关人) 
        /// </summary> 
        public System.String a_sGuidBaseCommision_Policy_PublicRelations = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 开始折扣 
        /// </summary> 
        public System.Double? a_nDiscount_Start = null;
        /// <summary> 
        /// 结束折扣 
        /// </summary> 
        public System.Double? a_nDiscount_End = null;
        /// <summary> 
        /// 下点比例 
        /// </summary> 
        public System.Double? a_nDownPercentage = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { this.a_sGuidBaseCommision_Policy_PublicRelations = ReplaceString.GetReplaceString(this.a_sGuidBaseCommision_Policy_PublicRelations); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCommision_Policy_PublicRelations_DiscountDown( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { mySqlScript += "sGuidBaseCommision_Policy_PublicRelations,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_nDiscount_Start != null) { mySqlScript += "nDiscount_Start,"; }
            if (this.a_nDiscount_End != null) { mySqlScript += "nDiscount_End,"; }
            if (this.a_nDownPercentage != null) { mySqlScript += "nDownPercentage,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { mySqlScript += "'" + this.a_sGuidBaseCommision_Policy_PublicRelations + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_nDiscount_Start != null) { mySqlScript += this.a_nDiscount_Start + ","; }
            if (this.a_nDiscount_End != null) { mySqlScript += this.a_nDiscount_End + ","; }
            if (this.a_nDownPercentage != null) { mySqlScript += this.a_nDownPercentage + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCommision_Policy_PublicRelations_DiscountDown set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { iColumnCount++; mySqlScript += " sGuidBaseCommision_Policy_PublicRelations = '" + this.a_sGuidBaseCommision_Policy_PublicRelations + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_nDiscount_Start != null) { iColumnCount++; mySqlScript += " nDiscount_Start = " + this.a_nDiscount_Start + ","; }
            if (this.a_nDiscount_End != null) { iColumnCount++; mySqlScript += " nDiscount_End = " + this.a_nDiscount_End + ","; }
            if (this.a_nDownPercentage != null) { iColumnCount++; mySqlScript += " nDownPercentage = " + this.a_nDownPercentage + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCommision_Policy_PublicRelations_DiscountDown Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //佣金比例设置(公关人)( BaseCommision_Policy_PublicRelations_Percentage )  
    /// <summary>
    /// 佣金比例设置(公关人)
    /// </summary>
    public partial class Sql_BaseCommision_Policy_PublicRelations_Percentage
    {
        #region 与数据表(佣金比例设置(公关人))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 佣金政策(业务员) 
        /// </summary> 
        public System.String a_sGuidBaseCommision_Policy_PublicRelations = null;
        /// <summary> 
        /// 内容类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_ContentType = null;
        /// <summary> 
        /// 内容类别 
        /// </summary> 
        public System.String a_sNameBasePrice_ContentType = null;
        /// <summary> 
        /// 部门1级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_1 = null;
        /// <summary> 
        /// 部门2级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_2 = null;
        /// <summary> 
        /// 部门3级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_3 = null;
        /// <summary> 
        /// 部门1级 
        /// </summary> 
        public System.String a_sNameBase_Department_1 = null;
        /// <summary> 
        /// 部门2级 
        /// </summary> 
        public System.String a_sNameBase_Department_2 = null;
        /// <summary> 
        /// 部门3级 
        /// </summary> 
        public System.String a_sNameBase_Department_3 = null;
        /// <summary> 
        /// 业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 业务员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person = null;
        /// <summary> 
        /// 广告规格ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_Specification = null;
        /// <summary> 
        /// 广告规格 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_Specification = null;
        /// <summary> 
        /// 版位类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 版位类别 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 色彩ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Color = null;
        /// <summary> 
        /// 色彩 
        /// </summary> 
        public System.String a_sNameBasePrice_Color = null;
        /// <summary> 
        /// 行业1级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_1 = null;
        /// <summary> 
        /// 行业2级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_2 = null;
        /// <summary> 
        /// 行业3级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_3 = null;
        /// <summary> 
        /// 行业1级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_1 = null;
        /// <summary> 
        /// 行业2级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_2 = null;
        /// <summary> 
        /// 行业3级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_3 = null;
        /// <summary> 
        /// 地区ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Region = null;
        /// <summary> 
        /// 地区 
        /// </summary> 
        public System.String a_sNameBaseOrder_Region = null;
        /// <summary> 
        /// 佣金比例 
        /// </summary> 
        public System.Double? a_nPercentage = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { this.a_sGuidBaseCommision_Policy_PublicRelations = ReplaceString.GetReplaceString(this.a_sGuidBaseCommision_Policy_PublicRelations); }
            if (this.a_sGuidBasePrice_ContentType != null) { this.a_sGuidBasePrice_ContentType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_ContentType); }
            if (this.a_sNameBasePrice_ContentType != null) { this.a_sNameBasePrice_ContentType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_ContentType); }
            if (this.a_sGuidBase_Department_1 != null) { this.a_sGuidBase_Department_1 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_1); }
            if (this.a_sGuidBase_Department_2 != null) { this.a_sGuidBase_Department_2 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_2); }
            if (this.a_sGuidBase_Department_3 != null) { this.a_sGuidBase_Department_3 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_3); }
            if (this.a_sNameBase_Department_1 != null) { this.a_sNameBase_Department_1 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_1); }
            if (this.a_sNameBase_Department_2 != null) { this.a_sNameBase_Department_2 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_2); }
            if (this.a_sNameBase_Department_3 != null) { this.a_sNameBase_Department_3 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_3); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sNameBase_Department_Person != null) { this.a_sNameBase_Department_Person = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person); }
            if (this.a_sGuidBasePrice_Media_Specification != null) { this.a_sGuidBasePrice_Media_Specification = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_Specification); }
            if (this.a_sNameBasePrice_Media_Specification != null) { this.a_sNameBasePrice_Media_Specification = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_Specification); }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { this.a_sGuidBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_PagePositionType); }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { this.a_sNameBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_PagePositionType); }
            if (this.a_sGuidBasePrice_Color != null) { this.a_sGuidBasePrice_Color = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Color); }
            if (this.a_sNameBasePrice_Color != null) { this.a_sNameBasePrice_Color = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Color); }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { this.a_sGuidBaseOrder_Industry_1 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_1); }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { this.a_sGuidBaseOrder_Industry_2 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_2); }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { this.a_sGuidBaseOrder_Industry_3 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_3); }
            if (this.a_sNameBaseOrder_Industry_1 != null) { this.a_sNameBaseOrder_Industry_1 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_1); }
            if (this.a_sNameBaseOrder_Industry_2 != null) { this.a_sNameBaseOrder_Industry_2 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_2); }
            if (this.a_sNameBaseOrder_Industry_3 != null) { this.a_sNameBaseOrder_Industry_3 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_3); }
            if (this.a_sGuidBaseOrder_Region != null) { this.a_sGuidBaseOrder_Region = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Region); }
            if (this.a_sNameBaseOrder_Region != null) { this.a_sNameBaseOrder_Region = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Region); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCommision_Policy_PublicRelations_Percentage( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { mySqlScript += "sGuidBaseCommision_Policy_PublicRelations,"; }
            if (this.a_sGuidBasePrice_ContentType != null) { mySqlScript += "sGuidBasePrice_ContentType,"; }
            if (this.a_sNameBasePrice_ContentType != null) { mySqlScript += "sNameBasePrice_ContentType,"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "sGuidBase_Department_1,"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "sGuidBase_Department_2,"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "sGuidBase_Department_3,"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "sNameBase_Department_1,"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "sNameBase_Department_2,"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "sNameBase_Department_3,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "sNameBase_Department_Person,"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { mySqlScript += "sGuidBasePrice_Media_Specification,"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { mySqlScript += "sNameBasePrice_Media_Specification,"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "sGuidBasePrice_Media_PagePositionType,"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "sNameBasePrice_Media_PagePositionType,"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "sGuidBasePrice_Color,"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "sNameBasePrice_Color,"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { mySqlScript += "sGuidBaseOrder_Industry_1,"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { mySqlScript += "sGuidBaseOrder_Industry_2,"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { mySqlScript += "sGuidBaseOrder_Industry_3,"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { mySqlScript += "sNameBaseOrder_Industry_1,"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { mySqlScript += "sNameBaseOrder_Industry_2,"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { mySqlScript += "sNameBaseOrder_Industry_3,"; }
            if (this.a_sGuidBaseOrder_Region != null) { mySqlScript += "sGuidBaseOrder_Region,"; }
            if (this.a_sNameBaseOrder_Region != null) { mySqlScript += "sNameBaseOrder_Region,"; }
            if (this.a_nPercentage != null) { mySqlScript += "nPercentage,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { mySqlScript += "'" + this.a_sGuidBaseCommision_Policy_PublicRelations + "',"; }
            if (this.a_sGuidBasePrice_ContentType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_ContentType + "',"; }
            if (this.a_sNameBasePrice_ContentType != null) { mySqlScript += "'" + this.a_sNameBasePrice_ContentType + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "'" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "'" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "'" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_Specification + "',"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_Specification + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "'" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_1 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_2 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_3 + "',"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_1 + "',"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_2 + "',"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_3 + "',"; }
            if (this.a_sGuidBaseOrder_Region != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Region + "',"; }
            if (this.a_sNameBaseOrder_Region != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Region + "',"; }
            if (this.a_nPercentage != null) { mySqlScript += this.a_nPercentage + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCommision_Policy_PublicRelations_Percentage set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { iColumnCount++; mySqlScript += " sGuidBaseCommision_Policy_PublicRelations = '" + this.a_sGuidBaseCommision_Policy_PublicRelations + "',"; }
            if (this.a_sGuidBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_ContentType = '" + this.a_sGuidBasePrice_ContentType + "',"; }
            if (this.a_sNameBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_ContentType = '" + this.a_sNameBasePrice_ContentType + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_1 = '" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_2 = '" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_3 = '" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_sNameBase_Department_1 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_1 = '" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_2 = '" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_3 = '" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person = '" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_Specification = '" + this.a_sGuidBasePrice_Media_Specification + "',"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_Specification = '" + this.a_sNameBasePrice_Media_Specification + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_PagePositionType = '" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_PagePositionType = '" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Color = '" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Color = '" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_1 = '" + this.a_sGuidBaseOrder_Industry_1 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_2 = '" + this.a_sGuidBaseOrder_Industry_2 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_3 = '" + this.a_sGuidBaseOrder_Industry_3 + "',"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_1 = '" + this.a_sNameBaseOrder_Industry_1 + "',"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_2 = '" + this.a_sNameBaseOrder_Industry_2 + "',"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_3 = '" + this.a_sNameBaseOrder_Industry_3 + "',"; }
            if (this.a_sGuidBaseOrder_Region != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Region = '" + this.a_sGuidBaseOrder_Region + "',"; }
            if (this.a_sNameBaseOrder_Region != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Region = '" + this.a_sNameBaseOrder_Region + "',"; }
            if (this.a_nPercentage != null) { iColumnCount++; mySqlScript += " nPercentage = " + this.a_nPercentage + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCommision_Policy_PublicRelations_Percentage Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //客户/代理/代理人( BaseCRM_Customer )  
    /// <summary>
    /// 客户/代理/代理人
    /// </summary>
    public partial class Sql_BaseCRM_Customer
    {
        #region 与数据表(客户/代理/代理人)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 类型(客户/代理公司/代理人) 
        /// </summary> 
        public System.String a_sType = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 简码 
        /// </summary> 
        public System.String a_sBrevityCode = null;
        /// <summary> 
        /// 客户编号 
        /// </summary> 
        public System.String a_sCustomerNum = null;
        /// <summary> 
        /// 父级Guid 
        /// </summary> 
        public System.String a_sGuidParent = null;
        /// <summary> 
        /// 级别 
        /// </summary> 
        public System.Int32? a_iDepth = null;
        /// <summary> 
        /// 地址 
        /// </summary> 
        public System.String a_sAddress = null;
        /// <summary> 
        /// 联系人 
        /// </summary> 
        public System.String a_sContactMan = null;
        /// <summary> 
        /// 电话 
        /// </summary> 
        public System.String a_sPhone = null;
        /// <summary> 
        /// 传真号码 
        /// </summary> 
        public System.String a_sFax = null;
        /// <summary> 
        /// 邮箱地址 
        /// </summary> 
        public System.String a_sEmail = null;
        /// <summary> 
        /// 邮编 
        /// </summary> 
        public System.String a_sPostCode = null;
        /// <summary> 
        /// 客户分类() 
        /// </summary> 
        public System.String a_sCustomerCategories = null;
        /// <summary> 
        /// 客户地域 
        /// </summary> 
        public System.String a_sCustomerArea = null;
        /// <summary> 
        /// 客户状态 
        /// </summary> 
        public System.String a_sCustomerStatus = null;
        /// <summary> 
        /// 客户信誉度 
        /// </summary> 
        public System.String a_sCustomerCredibility = null;
        /// <summary> 
        /// 业务员 
        /// </summary> 
        public System.String a_sEmployee = null;
        /// <summary> 
        /// 网址 
        /// </summary> 
        public System.String a_sWebsite = null;
        /// <summary> 
        /// 开户银行 
        /// </summary> 
        public System.String a_sBank = null;
        /// <summary> 
        /// 账号 
        /// </summary> 
        public System.String a_sBank_Account = null;
        /// <summary> 
        /// 部门 
        /// </summary> 
        public System.String a_sDepartments = null;
        /// <summary> 
        /// 职务 
        /// </summary> 
        public System.String a_sDuties = null;
        /// <summary> 
        /// 默认行业ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry = null;
        /// <summary> 
        /// 默认行业 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry = null;
        /// <summary> 
        /// 默认地域ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Source = null;
        /// <summary> 
        /// 默认地域 
        /// </summary> 
        public System.String a_sNameBaseOrder_Source = null;
        /// <summary> 
        /// 协议折扣比例 
        /// </summary> 
        public System.Double? a_nDiscountPercentage = null;
        /// <summary> 
        /// 业务员ID(主) 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 业务员(主) 
        /// </summary> 
        public System.String a_NameBase_Department_Person = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sType != null) { this.a_sType = ReplaceString.GetReplaceString(this.a_sType); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sBrevityCode != null) { this.a_sBrevityCode = ReplaceString.GetReplaceString(this.a_sBrevityCode); }
            if (this.a_sCustomerNum != null) { this.a_sCustomerNum = ReplaceString.GetReplaceString(this.a_sCustomerNum); }
            if (this.a_sGuidParent != null) { this.a_sGuidParent = ReplaceString.GetReplaceString(this.a_sGuidParent); }
            if (this.a_sAddress != null) { this.a_sAddress = ReplaceString.GetReplaceString(this.a_sAddress); }
            if (this.a_sContactMan != null) { this.a_sContactMan = ReplaceString.GetReplaceString(this.a_sContactMan); }
            if (this.a_sPhone != null) { this.a_sPhone = ReplaceString.GetReplaceString(this.a_sPhone); }
            if (this.a_sFax != null) { this.a_sFax = ReplaceString.GetReplaceString(this.a_sFax); }
            if (this.a_sEmail != null) { this.a_sEmail = ReplaceString.GetReplaceString(this.a_sEmail); }
            if (this.a_sPostCode != null) { this.a_sPostCode = ReplaceString.GetReplaceString(this.a_sPostCode); }
            if (this.a_sCustomerCategories != null) { this.a_sCustomerCategories = ReplaceString.GetReplaceString(this.a_sCustomerCategories); }
            if (this.a_sCustomerArea != null) { this.a_sCustomerArea = ReplaceString.GetReplaceString(this.a_sCustomerArea); }
            if (this.a_sCustomerStatus != null) { this.a_sCustomerStatus = ReplaceString.GetReplaceString(this.a_sCustomerStatus); }
            if (this.a_sCustomerCredibility != null) { this.a_sCustomerCredibility = ReplaceString.GetReplaceString(this.a_sCustomerCredibility); }
            if (this.a_sEmployee != null) { this.a_sEmployee = ReplaceString.GetReplaceString(this.a_sEmployee); }
            if (this.a_sWebsite != null) { this.a_sWebsite = ReplaceString.GetReplaceString(this.a_sWebsite); }
            if (this.a_sBank != null) { this.a_sBank = ReplaceString.GetReplaceString(this.a_sBank); }
            if (this.a_sBank_Account != null) { this.a_sBank_Account = ReplaceString.GetReplaceString(this.a_sBank_Account); }
            if (this.a_sDepartments != null) { this.a_sDepartments = ReplaceString.GetReplaceString(this.a_sDepartments); }
            if (this.a_sDuties != null) { this.a_sDuties = ReplaceString.GetReplaceString(this.a_sDuties); }
            if (this.a_sGuidBaseOrder_Industry != null) { this.a_sGuidBaseOrder_Industry = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry); }
            if (this.a_sNameBaseOrder_Industry != null) { this.a_sNameBaseOrder_Industry = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry); }
            if (this.a_sGuidBaseOrder_Source != null) { this.a_sGuidBaseOrder_Source = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Source); }
            if (this.a_sNameBaseOrder_Source != null) { this.a_sNameBaseOrder_Source = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Source); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_NameBase_Department_Person != null) { this.a_NameBase_Department_Person = ReplaceString.GetReplaceString(this.a_NameBase_Department_Person); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCRM_Customer( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sType != null) { mySqlScript += "sType,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sBrevityCode != null) { mySqlScript += "sBrevityCode,"; }
            if (this.a_sCustomerNum != null) { mySqlScript += "sCustomerNum,"; }
            if (this.a_sGuidParent != null) { mySqlScript += "sGuidParent,"; }
            if (this.a_iDepth != null) { mySqlScript += "iDepth,"; }
            if (this.a_sAddress != null) { mySqlScript += "sAddress,"; }
            if (this.a_sContactMan != null) { mySqlScript += "sContactMan,"; }
            if (this.a_sPhone != null) { mySqlScript += "sPhone,"; }
            if (this.a_sFax != null) { mySqlScript += "sFax,"; }
            if (this.a_sEmail != null) { mySqlScript += "sEmail,"; }
            if (this.a_sPostCode != null) { mySqlScript += "sPostCode,"; }
            if (this.a_sCustomerCategories != null) { mySqlScript += "sCustomerCategories,"; }
            if (this.a_sCustomerArea != null) { mySqlScript += "sCustomerArea,"; }
            if (this.a_sCustomerStatus != null) { mySqlScript += "sCustomerStatus,"; }
            if (this.a_sCustomerCredibility != null) { mySqlScript += "sCustomerCredibility,"; }
            if (this.a_sEmployee != null) { mySqlScript += "sEmployee,"; }
            if (this.a_sWebsite != null) { mySqlScript += "sWebsite,"; }
            if (this.a_sBank != null) { mySqlScript += "sBank,"; }
            if (this.a_sBank_Account != null) { mySqlScript += "sBank_Account,"; }
            if (this.a_sDepartments != null) { mySqlScript += "sDepartments,"; }
            if (this.a_sDuties != null) { mySqlScript += "sDuties,"; }
            if (this.a_sGuidBaseOrder_Industry != null) { mySqlScript += "sGuidBaseOrder_Industry,"; }
            if (this.a_sNameBaseOrder_Industry != null) { mySqlScript += "sNameBaseOrder_Industry,"; }
            if (this.a_sGuidBaseOrder_Source != null) { mySqlScript += "sGuidBaseOrder_Source,"; }
            if (this.a_sNameBaseOrder_Source != null) { mySqlScript += "sNameBaseOrder_Source,"; }
            if (this.a_nDiscountPercentage != null) { mySqlScript += "nDiscountPercentage,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_NameBase_Department_Person != null) { mySqlScript += "NameBase_Department_Person,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { mySqlScript += "'" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sBrevityCode != null) { mySqlScript += "'" + this.a_sBrevityCode + "',"; }
            if (this.a_sCustomerNum != null) { mySqlScript += "'" + this.a_sCustomerNum + "',"; }
            if (this.a_sGuidParent != null) { mySqlScript += "'" + this.a_sGuidParent + "',"; }
            if (this.a_iDepth != null) { mySqlScript += this.a_iDepth + ","; }
            if (this.a_sAddress != null) { mySqlScript += "'" + this.a_sAddress + "',"; }
            if (this.a_sContactMan != null) { mySqlScript += "'" + this.a_sContactMan + "',"; }
            if (this.a_sPhone != null) { mySqlScript += "'" + this.a_sPhone + "',"; }
            if (this.a_sFax != null) { mySqlScript += "'" + this.a_sFax + "',"; }
            if (this.a_sEmail != null) { mySqlScript += "'" + this.a_sEmail + "',"; }
            if (this.a_sPostCode != null) { mySqlScript += "'" + this.a_sPostCode + "',"; }
            if (this.a_sCustomerCategories != null) { mySqlScript += "'" + this.a_sCustomerCategories + "',"; }
            if (this.a_sCustomerArea != null) { mySqlScript += "'" + this.a_sCustomerArea + "',"; }
            if (this.a_sCustomerStatus != null) { mySqlScript += "'" + this.a_sCustomerStatus + "',"; }
            if (this.a_sCustomerCredibility != null) { mySqlScript += "'" + this.a_sCustomerCredibility + "',"; }
            if (this.a_sEmployee != null) { mySqlScript += "'" + this.a_sEmployee + "',"; }
            if (this.a_sWebsite != null) { mySqlScript += "'" + this.a_sWebsite + "',"; }
            if (this.a_sBank != null) { mySqlScript += "'" + this.a_sBank + "',"; }
            if (this.a_sBank_Account != null) { mySqlScript += "'" + this.a_sBank_Account + "',"; }
            if (this.a_sDepartments != null) { mySqlScript += "'" + this.a_sDepartments + "',"; }
            if (this.a_sDuties != null) { mySqlScript += "'" + this.a_sDuties + "',"; }
            if (this.a_sGuidBaseOrder_Industry != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry + "',"; }
            if (this.a_sNameBaseOrder_Industry != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry + "',"; }
            if (this.a_sGuidBaseOrder_Source != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Source + "',"; }
            if (this.a_sNameBaseOrder_Source != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Source + "',"; }
            if (this.a_nDiscountPercentage != null) { mySqlScript += this.a_nDiscountPercentage + ","; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_NameBase_Department_Person != null) { mySqlScript += "'" + this.a_NameBase_Department_Person + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCRM_Customer set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { iColumnCount++; mySqlScript += " sType = '" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sBrevityCode != null) { iColumnCount++; mySqlScript += " sBrevityCode = '" + this.a_sBrevityCode + "',"; }
            if (this.a_sCustomerNum != null) { iColumnCount++; mySqlScript += " sCustomerNum = '" + this.a_sCustomerNum + "',"; }
            if (this.a_sGuidParent != null) { iColumnCount++; mySqlScript += " sGuidParent = '" + this.a_sGuidParent + "',"; }
            if (this.a_iDepth != null) { iColumnCount++; mySqlScript += " iDepth = " + this.a_iDepth + ","; }
            if (this.a_sAddress != null) { iColumnCount++; mySqlScript += " sAddress = '" + this.a_sAddress + "',"; }
            if (this.a_sContactMan != null) { iColumnCount++; mySqlScript += " sContactMan = '" + this.a_sContactMan + "',"; }
            if (this.a_sPhone != null) { iColumnCount++; mySqlScript += " sPhone = '" + this.a_sPhone + "',"; }
            if (this.a_sFax != null) { iColumnCount++; mySqlScript += " sFax = '" + this.a_sFax + "',"; }
            if (this.a_sEmail != null) { iColumnCount++; mySqlScript += " sEmail = '" + this.a_sEmail + "',"; }
            if (this.a_sPostCode != null) { iColumnCount++; mySqlScript += " sPostCode = '" + this.a_sPostCode + "',"; }
            if (this.a_sCustomerCategories != null) { iColumnCount++; mySqlScript += " sCustomerCategories = '" + this.a_sCustomerCategories + "',"; }
            if (this.a_sCustomerArea != null) { iColumnCount++; mySqlScript += " sCustomerArea = '" + this.a_sCustomerArea + "',"; }
            if (this.a_sCustomerStatus != null) { iColumnCount++; mySqlScript += " sCustomerStatus = '" + this.a_sCustomerStatus + "',"; }
            if (this.a_sCustomerCredibility != null) { iColumnCount++; mySqlScript += " sCustomerCredibility = '" + this.a_sCustomerCredibility + "',"; }
            if (this.a_sEmployee != null) { iColumnCount++; mySqlScript += " sEmployee = '" + this.a_sEmployee + "',"; }
            if (this.a_sWebsite != null) { iColumnCount++; mySqlScript += " sWebsite = '" + this.a_sWebsite + "',"; }
            if (this.a_sBank != null) { iColumnCount++; mySqlScript += " sBank = '" + this.a_sBank + "',"; }
            if (this.a_sBank_Account != null) { iColumnCount++; mySqlScript += " sBank_Account = '" + this.a_sBank_Account + "',"; }
            if (this.a_sDepartments != null) { iColumnCount++; mySqlScript += " sDepartments = '" + this.a_sDepartments + "',"; }
            if (this.a_sDuties != null) { iColumnCount++; mySqlScript += " sDuties = '" + this.a_sDuties + "',"; }
            if (this.a_sGuidBaseOrder_Industry != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry = '" + this.a_sGuidBaseOrder_Industry + "',"; }
            if (this.a_sNameBaseOrder_Industry != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry = '" + this.a_sNameBaseOrder_Industry + "',"; }
            if (this.a_sGuidBaseOrder_Source != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Source = '" + this.a_sGuidBaseOrder_Source + "',"; }
            if (this.a_sNameBaseOrder_Source != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Source = '" + this.a_sNameBaseOrder_Source + "',"; }
            if (this.a_nDiscountPercentage != null) { iColumnCount++; mySqlScript += " nDiscountPercentage = " + this.a_nDiscountPercentage + ","; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_NameBase_Department_Person != null) { iColumnCount++; mySqlScript += " NameBase_Department_Person = '" + this.a_NameBase_Department_Person + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCRM_Customer Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //客户地址( BaseCRM_Customer_Address )  
    /// <summary>
    /// 客户地址
    /// </summary>
    public partial class Sql_BaseCRM_Customer_Address
    {
        #region 与数据表(客户地址)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 地址类型(办公地址/会议地址/邮寄地址/家庭地址) 
        /// </summary> 
        public System.String a_sAddressType = null;
        /// <summary> 
        /// 地址 
        /// </summary> 
        public System.String a_sAddress = null;
        /// <summary> 
        /// 邮政编码 
        /// </summary> 
        public System.String a_sPostCode = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sAddressType != null) { this.a_sAddressType = ReplaceString.GetReplaceString(this.a_sAddressType); }
            if (this.a_sAddress != null) { this.a_sAddress = ReplaceString.GetReplaceString(this.a_sAddress); }
            if (this.a_sPostCode != null) { this.a_sPostCode = ReplaceString.GetReplaceString(this.a_sPostCode); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCRM_Customer_Address( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sAddressType != null) { mySqlScript += "sAddressType,"; }
            if (this.a_sAddress != null) { mySqlScript += "sAddress,"; }
            if (this.a_sPostCode != null) { mySqlScript += "sPostCode,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sAddressType != null) { mySqlScript += "'" + this.a_sAddressType + "',"; }
            if (this.a_sAddress != null) { mySqlScript += "'" + this.a_sAddress + "',"; }
            if (this.a_sPostCode != null) { mySqlScript += "'" + this.a_sPostCode + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCRM_Customer_Address set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sAddressType != null) { iColumnCount++; mySqlScript += " sAddressType = '" + this.a_sAddressType + "',"; }
            if (this.a_sAddress != null) { iColumnCount++; mySqlScript += " sAddress = '" + this.a_sAddress + "',"; }
            if (this.a_sPostCode != null) { iColumnCount++; mySqlScript += " sPostCode = '" + this.a_sPostCode + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCRM_Customer_Address Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //客户属于的代理公司( BaseCRM_Customer_BelongAgent )  
    /// <summary>
    /// 客户属于的代理公司
    /// </summary>
    public partial class Sql_BaseCRM_Customer_BelongAgent
    {
        #region 与数据表(客户属于的代理公司)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 代理ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer_Agent = null;
        /// <summary> 
        /// 代理 
        /// </summary> 
        public System.String a_sNameBaseCRM_Customer_Agent = null;
        /// <summary> 
        /// 代理编号 
        /// </summary> 
        public System.String a_sAgentNum = null;
        /// <summary> 
        /// 代理公司 
        /// </summary> 
        public System.String a_sAgentAddress = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sGuidBaseCRM_Customer_Agent != null) { this.a_sGuidBaseCRM_Customer_Agent = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer_Agent); }
            if (this.a_sNameBaseCRM_Customer_Agent != null) { this.a_sNameBaseCRM_Customer_Agent = ReplaceString.GetReplaceString(this.a_sNameBaseCRM_Customer_Agent); }
            if (this.a_sAgentNum != null) { this.a_sAgentNum = ReplaceString.GetReplaceString(this.a_sAgentNum); }
            if (this.a_sAgentAddress != null) { this.a_sAgentAddress = ReplaceString.GetReplaceString(this.a_sAgentAddress); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCRM_Customer_BelongAgent( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_sGuidBaseCRM_Customer_Agent != null) { mySqlScript += "sGuidBaseCRM_Customer_Agent,"; }
            if (this.a_sNameBaseCRM_Customer_Agent != null) { mySqlScript += "sNameBaseCRM_Customer_Agent,"; }
            if (this.a_sAgentNum != null) { mySqlScript += "sAgentNum,"; }
            if (this.a_sAgentAddress != null) { mySqlScript += "sAgentAddress,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sGuidBaseCRM_Customer_Agent != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer_Agent + "',"; }
            if (this.a_sNameBaseCRM_Customer_Agent != null) { mySqlScript += "'" + this.a_sNameBaseCRM_Customer_Agent + "',"; }
            if (this.a_sAgentNum != null) { mySqlScript += "'" + this.a_sAgentNum + "',"; }
            if (this.a_sAgentAddress != null) { mySqlScript += "'" + this.a_sAgentAddress + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCRM_Customer_BelongAgent set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sGuidBaseCRM_Customer_Agent != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer_Agent = '" + this.a_sGuidBaseCRM_Customer_Agent + "',"; }
            if (this.a_sNameBaseCRM_Customer_Agent != null) { iColumnCount++; mySqlScript += " sNameBaseCRM_Customer_Agent = '" + this.a_sNameBaseCRM_Customer_Agent + "',"; }
            if (this.a_sAgentNum != null) { iColumnCount++; mySqlScript += " sAgentNum = '" + this.a_sAgentNum + "',"; }
            if (this.a_sAgentAddress != null) { iColumnCount++; mySqlScript += " sAgentAddress = '" + this.a_sAgentAddress + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCRM_Customer_BelongAgent Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //品牌( BaseCRM_Customer_Brand )  
    /// <summary>
    /// 品牌
    /// </summary>
    public partial class Sql_BaseCRM_Customer_Brand
    {
        #region 与数据表(品牌)对应的字段属性
        /// <summary> 
        /// 品牌 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 是否有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCRM_Customer_Brand( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCRM_Customer_Brand set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCRM_Customer_Brand Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //客户联系人( BaseCRM_Customer_ContactMan )  
    /// <summary>
    /// 客户联系人
    /// </summary>
    public partial class Sql_BaseCRM_Customer_ContactMan
    {
        #region 与数据表(客户联系人)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 职务 
        /// </summary> 
        public System.String a_sDuties = null;
        /// <summary> 
        /// 部门 
        /// </summary> 
        public System.String a_sDepartments = null;
        /// <summary> 
        /// 邮箱地址 
        /// </summary> 
        public System.String a_sEmail = null;
        /// <summary> 
        /// QQ号码 
        /// </summary> 
        public System.String a_sQQNum = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 电话 
        /// </summary> 
        public System.String a_sPhone = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sDuties != null) { this.a_sDuties = ReplaceString.GetReplaceString(this.a_sDuties); }
            if (this.a_sDepartments != null) { this.a_sDepartments = ReplaceString.GetReplaceString(this.a_sDepartments); }
            if (this.a_sEmail != null) { this.a_sEmail = ReplaceString.GetReplaceString(this.a_sEmail); }
            if (this.a_sQQNum != null) { this.a_sQQNum = ReplaceString.GetReplaceString(this.a_sQQNum); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sPhone != null) { this.a_sPhone = ReplaceString.GetReplaceString(this.a_sPhone); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCRM_Customer_ContactMan( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sDuties != null) { mySqlScript += "sDuties,"; }
            if (this.a_sDepartments != null) { mySqlScript += "sDepartments,"; }
            if (this.a_sEmail != null) { mySqlScript += "sEmail,"; }
            if (this.a_sQQNum != null) { mySqlScript += "sQQNum,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sPhone != null) { mySqlScript += "sPhone,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sDuties != null) { mySqlScript += "'" + this.a_sDuties + "',"; }
            if (this.a_sDepartments != null) { mySqlScript += "'" + this.a_sDepartments + "',"; }
            if (this.a_sEmail != null) { mySqlScript += "'" + this.a_sEmail + "',"; }
            if (this.a_sQQNum != null) { mySqlScript += "'" + this.a_sQQNum + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sPhone != null) { mySqlScript += "'" + this.a_sPhone + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCRM_Customer_ContactMan set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sDuties != null) { iColumnCount++; mySqlScript += " sDuties = '" + this.a_sDuties + "',"; }
            if (this.a_sDepartments != null) { iColumnCount++; mySqlScript += " sDepartments = '" + this.a_sDepartments + "',"; }
            if (this.a_sEmail != null) { iColumnCount++; mySqlScript += " sEmail = '" + this.a_sEmail + "',"; }
            if (this.a_sQQNum != null) { iColumnCount++; mySqlScript += " sQQNum = '" + this.a_sQQNum + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sPhone != null) { iColumnCount++; mySqlScript += " sPhone = '" + this.a_sPhone + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCRM_Customer_ContactMan Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //客户协议折扣( BaseCRM_Customer_Discount )  
    /// <summary>
    /// 客户协议折扣
    /// </summary>
    public partial class Sql_BaseCRM_Customer_Discount
    {
        #region 与数据表(客户协议折扣)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 优先级 
        /// </summary> 
        public System.Int32? a_iPriority = null;
        /// <summary> 
        /// 折扣名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 媒体ID 
        /// </summary> 
        public System.String a_sGuidBaseMedia = null;
        /// <summary> 
        /// 媒体 
        /// </summary> 
        public System.String a_sNameBaseMedia = null;
        /// <summary> 
        /// 色彩ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Color = null;
        /// <summary> 
        /// 色彩 
        /// </summary> 
        public System.String a_sNameBasePrice_Color = null;
        /// <summary> 
        /// 行业1级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_1 = null;
        /// <summary> 
        /// 行业1级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_1 = null;
        /// <summary> 
        /// 行业2级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_2 = null;
        /// <summary> 
        /// 行业2级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_2 = null;
        /// <summary> 
        /// 行业3级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_3 = null;
        /// <summary> 
        /// 行业3级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_3 = null;
        /// <summary> 
        /// 星期ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Week = null;
        /// <summary> 
        /// 星期 
        /// </summary> 
        public System.String a_sNameBasePrice_Week = null;
        /// <summary> 
        /// 版位类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 版位类别 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 广告类型ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_AdvertisingType = null;
        /// <summary> 
        /// 广告类型 
        /// </summary> 
        public System.String a_sNameBaseOrder_AdvertisingType = null;
        /// <summary> 
        /// 长单类型ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_LongOrderType = null;
        /// <summary> 
        /// 长单类型 
        /// </summary> 
        public System.String a_sNameBaseOrder_LongOrderType = null;
        /// <summary> 
        /// 折扣率 
        /// </summary> 
        public System.Double? a_nDiscount = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sGuidBaseMedia != null) { this.a_sGuidBaseMedia = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia); }
            if (this.a_sNameBaseMedia != null) { this.a_sNameBaseMedia = ReplaceString.GetReplaceString(this.a_sNameBaseMedia); }
            if (this.a_sGuidBasePrice_Color != null) { this.a_sGuidBasePrice_Color = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Color); }
            if (this.a_sNameBasePrice_Color != null) { this.a_sNameBasePrice_Color = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Color); }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { this.a_sGuidBaseOrder_Industry_1 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_1); }
            if (this.a_sNameBaseOrder_Industry_1 != null) { this.a_sNameBaseOrder_Industry_1 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_1); }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { this.a_sGuidBaseOrder_Industry_2 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_2); }
            if (this.a_sNameBaseOrder_Industry_2 != null) { this.a_sNameBaseOrder_Industry_2 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_2); }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { this.a_sGuidBaseOrder_Industry_3 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_3); }
            if (this.a_sNameBaseOrder_Industry_3 != null) { this.a_sNameBaseOrder_Industry_3 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_3); }
            if (this.a_sGuidBasePrice_Week != null) { this.a_sGuidBasePrice_Week = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Week); }
            if (this.a_sNameBasePrice_Week != null) { this.a_sNameBasePrice_Week = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Week); }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { this.a_sGuidBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_PagePositionType); }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { this.a_sNameBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_PagePositionType); }
            if (this.a_sGuidBaseOrder_AdvertisingType != null) { this.a_sGuidBaseOrder_AdvertisingType = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_AdvertisingType); }
            if (this.a_sNameBaseOrder_AdvertisingType != null) { this.a_sNameBaseOrder_AdvertisingType = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_AdvertisingType); }
            if (this.a_sGuidBaseOrder_LongOrderType != null) { this.a_sGuidBaseOrder_LongOrderType = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_LongOrderType); }
            if (this.a_sNameBaseOrder_LongOrderType != null) { this.a_sNameBaseOrder_LongOrderType = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_LongOrderType); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseCRM_Customer_Discount( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iPriority != null) { mySqlScript += "iPriority,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "sGuidBaseMedia,"; }
            if (this.a_sNameBaseMedia != null) { mySqlScript += "sNameBaseMedia,"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "sGuidBasePrice_Color,"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "sNameBasePrice_Color,"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { mySqlScript += "sGuidBaseOrder_Industry_1,"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { mySqlScript += "sNameBaseOrder_Industry_1,"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { mySqlScript += "sGuidBaseOrder_Industry_2,"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { mySqlScript += "sNameBaseOrder_Industry_2,"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { mySqlScript += "sGuidBaseOrder_Industry_3,"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { mySqlScript += "sNameBaseOrder_Industry_3,"; }
            if (this.a_sGuidBasePrice_Week != null) { mySqlScript += "sGuidBasePrice_Week,"; }
            if (this.a_sNameBasePrice_Week != null) { mySqlScript += "sNameBasePrice_Week,"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "sGuidBasePrice_Media_PagePositionType,"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "sNameBasePrice_Media_PagePositionType,"; }
            if (this.a_sGuidBaseOrder_AdvertisingType != null) { mySqlScript += "sGuidBaseOrder_AdvertisingType,"; }
            if (this.a_sNameBaseOrder_AdvertisingType != null) { mySqlScript += "sNameBaseOrder_AdvertisingType,"; }
            if (this.a_sGuidBaseOrder_LongOrderType != null) { mySqlScript += "sGuidBaseOrder_LongOrderType,"; }
            if (this.a_sNameBaseOrder_LongOrderType != null) { mySqlScript += "sNameBaseOrder_LongOrderType,"; }
            if (this.a_nDiscount != null) { mySqlScript += "nDiscount,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iPriority != null) { mySqlScript += this.a_iPriority + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "'" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_sNameBaseMedia != null) { mySqlScript += "'" + this.a_sNameBaseMedia + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "'" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_1 + "',"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_1 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_2 + "',"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_2 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_3 + "',"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_3 + "',"; }
            if (this.a_sGuidBasePrice_Week != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Week + "',"; }
            if (this.a_sNameBasePrice_Week != null) { mySqlScript += "'" + this.a_sNameBasePrice_Week + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBaseOrder_AdvertisingType != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_AdvertisingType + "',"; }
            if (this.a_sNameBaseOrder_AdvertisingType != null) { mySqlScript += "'" + this.a_sNameBaseOrder_AdvertisingType + "',"; }
            if (this.a_sGuidBaseOrder_LongOrderType != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_LongOrderType + "',"; }
            if (this.a_sNameBaseOrder_LongOrderType != null) { mySqlScript += "'" + this.a_sNameBaseOrder_LongOrderType + "',"; }
            if (this.a_nDiscount != null) { mySqlScript += this.a_nDiscount + ","; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseCRM_Customer_Discount set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iPriority != null) { iColumnCount++; mySqlScript += " iPriority = " + this.a_iPriority + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sGuidBaseMedia != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia = '" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_sNameBaseMedia != null) { iColumnCount++; mySqlScript += " sNameBaseMedia = '" + this.a_sNameBaseMedia + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Color = '" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Color = '" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_1 = '" + this.a_sGuidBaseOrder_Industry_1 + "',"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_1 = '" + this.a_sNameBaseOrder_Industry_1 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_2 = '" + this.a_sGuidBaseOrder_Industry_2 + "',"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_2 = '" + this.a_sNameBaseOrder_Industry_2 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_3 = '" + this.a_sGuidBaseOrder_Industry_3 + "',"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_3 = '" + this.a_sNameBaseOrder_Industry_3 + "',"; }
            if (this.a_sGuidBasePrice_Week != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Week = '" + this.a_sGuidBasePrice_Week + "',"; }
            if (this.a_sNameBasePrice_Week != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Week = '" + this.a_sNameBasePrice_Week + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_PagePositionType = '" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_PagePositionType = '" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBaseOrder_AdvertisingType != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_AdvertisingType = '" + this.a_sGuidBaseOrder_AdvertisingType + "',"; }
            if (this.a_sNameBaseOrder_AdvertisingType != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_AdvertisingType = '" + this.a_sNameBaseOrder_AdvertisingType + "',"; }
            if (this.a_sGuidBaseOrder_LongOrderType != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_LongOrderType = '" + this.a_sGuidBaseOrder_LongOrderType + "',"; }
            if (this.a_sNameBaseOrder_LongOrderType != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_LongOrderType = '" + this.a_sNameBaseOrder_LongOrderType + "',"; }
            if (this.a_nDiscount != null) { iColumnCount++; mySqlScript += " nDiscount = " + this.a_nDiscount + ","; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseCRM_Customer_Discount Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //分类加大加黑设置( BaseInfoParameter_Categories_JDJH )  
    /// <summary>
    /// 分类加大加黑设置
    /// </summary>
    public partial class Sql_BaseInfoParameter_Categories_JDJH
    {
        #region 与数据表(分类加大加黑设置)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 媒体ID 
        /// </summary> 
        public System.String a_sGuidBaseMedia = null;
        /// <summary> 
        /// 媒体 
        /// </summary> 
        public System.String a_sNameBaseMedia = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称(描述) 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 字数 
        /// </summary> 
        public System.Int32? a_iWordCount = null;
        /// <summary> 
        /// 加价金额 
        /// </summary> 
        public System.Double? a_nAddMoney = null;
        /// <summary> 
        /// 是否加大 
        /// </summary> 
        public System.Boolean? a_bIncrease = null;
        /// <summary> 
        /// 是否加黑 
        /// </summary> 
        public System.Boolean? a_bWithBlack = null;
        /// <summary> 
        /// 是否默认 
        /// </summary> 
        public System.Boolean? a_bDefault = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseMedia != null) { this.a_sGuidBaseMedia = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia); }
            if (this.a_sNameBaseMedia != null) { this.a_sNameBaseMedia = ReplaceString.GetReplaceString(this.a_sNameBaseMedia); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseInfoParameter_Categories_JDJH( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "sGuidBaseMedia,"; }
            if (this.a_sNameBaseMedia != null) { mySqlScript += "sNameBaseMedia,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_iWordCount != null) { mySqlScript += "iWordCount,"; }
            if (this.a_nAddMoney != null) { mySqlScript += "nAddMoney,"; }
            if (this.a_bIncrease != null) { mySqlScript += "bIncrease,"; }
            if (this.a_bWithBlack != null) { mySqlScript += "bWithBlack,"; }
            if (this.a_bDefault != null) { mySqlScript += "bDefault,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "'" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_sNameBaseMedia != null) { mySqlScript += "'" + this.a_sNameBaseMedia + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_iWordCount != null) { mySqlScript += this.a_iWordCount + ","; }
            if (this.a_nAddMoney != null) { mySqlScript += this.a_nAddMoney + ","; }
            if (this.a_bIncrease != null) { mySqlScript += "'" + this.a_bIncrease + "',"; }
            if (this.a_bWithBlack != null) { mySqlScript += "'" + this.a_bWithBlack + "',"; }
            if (this.a_bDefault != null) { mySqlScript += "'" + this.a_bDefault + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseInfoParameter_Categories_JDJH set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseMedia != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia = '" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_sNameBaseMedia != null) { iColumnCount++; mySqlScript += " sNameBaseMedia = '" + this.a_sNameBaseMedia + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_iWordCount != null) { iColumnCount++; mySqlScript += " iWordCount = " + this.a_iWordCount + ","; }
            if (this.a_nAddMoney != null) { iColumnCount++; mySqlScript += " nAddMoney = " + this.a_nAddMoney + ","; }
            if (this.a_bIncrease != null) { iColumnCount++; mySqlScript += " bIncrease = '" + this.a_bIncrease + "',"; }
            if (this.a_bWithBlack != null) { iColumnCount++; mySqlScript += " bWithBlack = '" + this.a_bWithBlack + "',"; }
            if (this.a_bDefault != null) { iColumnCount++; mySqlScript += " bDefault = '" + this.a_bDefault + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseInfoParameter_Categories_JDJH Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //媒体( BaseMedia )  
    /// <summary>
    /// 媒体
    /// </summary>
    public partial class Sql_BaseMedia
    {
        #region 与数据表(媒体)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 媒体 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 发行周期 
        /// </summary> 
        public System.String a_sIssueCycle = null;
        /// <summary> 
        /// 发行日期(例如:周四) 
        /// </summary> 
        public System.String a_sIssueRange = null;
        /// <summary> 
        /// 默认 
        /// </summary> 
        public System.Boolean? a_bDefault = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sIssueCycle != null) { this.a_sIssueCycle = ReplaceString.GetReplaceString(this.a_sIssueCycle); }
            if (this.a_sIssueRange != null) { this.a_sIssueRange = ReplaceString.GetReplaceString(this.a_sIssueRange); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseMedia( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sIssueCycle != null) { mySqlScript += "sIssueCycle,"; }
            if (this.a_sIssueRange != null) { mySqlScript += "sIssueRange,"; }
            if (this.a_bDefault != null) { mySqlScript += "bDefault,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sIssueCycle != null) { mySqlScript += "'" + this.a_sIssueCycle + "',"; }
            if (this.a_sIssueRange != null) { mySqlScript += "'" + this.a_sIssueRange + "',"; }
            if (this.a_bDefault != null) { mySqlScript += "'" + this.a_bDefault + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseMedia set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sIssueCycle != null) { iColumnCount++; mySqlScript += " sIssueCycle = '" + this.a_sIssueCycle + "',"; }
            if (this.a_sIssueRange != null) { iColumnCount++; mySqlScript += " sIssueRange = '" + this.a_sIssueRange + "',"; }
            if (this.a_bDefault != null) { iColumnCount++; mySqlScript += " bDefault = '" + this.a_bDefault + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseMedia Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //叠次( BaseMedia_Fold )  
    /// <summary>
    /// 叠次
    /// </summary>
    public partial class Sql_BaseMedia_Fold
    {
        #region 与数据表(叠次)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 媒体ID 
        /// </summary> 
        public System.String a_sGuidBaseMedia = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseMedia != null) { this.a_sGuidBaseMedia = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseMedia_Fold( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "sGuidBaseMedia,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "'" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseMedia_Fold set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseMedia != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia = '" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseMedia_Fold Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //版面( BaseMedia_Fold_Page )  
    /// <summary>
    /// 版面
    /// </summary>
    public partial class Sql_BaseMedia_Fold_Page
    {
        #region 与数据表(版面)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 类型(设置/周计划/期计划) 
        /// </summary> 
        public System.String a_sType = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 媒体ID 
        /// </summary> 
        public System.String a_sGuidBaseMedia = null;
        /// <summary> 
        /// 发行日期(周计划例如:4) 
        /// </summary> 
        public System.String a_sIssueRange = null;
        /// <summary> 
        /// 叠次ID 
        /// </summary> 
        public System.String a_sGuidBaseMedia_Fold = null;
        /// <summary> 
        /// 叠次 
        /// </summary> 
        public System.String a_sNameBaseMedia_Fold = null;
        /// <summary> 
        /// 版面名称 
        /// </summary> 
        public System.String a_s_NamePage = null;
        /// <summary> 
        /// XML备注 
        /// </summary> 
        public System.String a_s_XML_Remark = null;
        /// <summary> 
        /// 说明(如:黑白体育版) 
        /// </summary> 
        public System.String a_sCaption = null;
        /// <summary> 
        /// 版心宽度 
        /// </summary> 
        public System.Double? a_nWidth = null;
        /// <summary> 
        /// 版心高度 
        /// </summary> 
        public System.Double? a_nHeight = null;
        /// <summary> 
        /// 计划截版时间 
        /// </summary> 
        public System.DateTime? a_dClosePage_Plan = null;
        /// <summary> 
        /// 实际截版时间 
        /// </summary> 
        public System.DateTime? a_dClosePage_Actual = null;
        /// <summary> 
        /// 广告占版量上限 
        /// </summary> 
        public System.Double? a_nAdvertisingAreaMax = null;
        /// <summary> 
        /// 中缝宽度 
        /// </summary> 
        public System.Double? a_nWidth_Raphe = null;
        /// <summary> 
        /// 色彩ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Color = null;
        /// <summary> 
        /// 色彩 
        /// </summary> 
        public System.String a_sNameBasePrice_Color = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sType != null) { this.a_sType = ReplaceString.GetReplaceString(this.a_sType); }
            if (this.a_sGuidBaseMedia != null) { this.a_sGuidBaseMedia = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia); }
            if (this.a_sIssueRange != null) { this.a_sIssueRange = ReplaceString.GetReplaceString(this.a_sIssueRange); }
            if (this.a_sGuidBaseMedia_Fold != null) { this.a_sGuidBaseMedia_Fold = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia_Fold); }
            if (this.a_sNameBaseMedia_Fold != null) { this.a_sNameBaseMedia_Fold = ReplaceString.GetReplaceString(this.a_sNameBaseMedia_Fold); }
            if (this.a_s_NamePage != null) { this.a_s_NamePage = ReplaceString.GetReplaceString(this.a_s_NamePage); }
            if (this.a_s_XML_Remark != null) { this.a_s_XML_Remark = ReplaceString.GetReplaceString(this.a_s_XML_Remark); }
            if (this.a_sCaption != null) { this.a_sCaption = ReplaceString.GetReplaceString(this.a_sCaption); }
            if (this.a_sGuidBasePrice_Color != null) { this.a_sGuidBasePrice_Color = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Color); }
            if (this.a_sNameBasePrice_Color != null) { this.a_sNameBasePrice_Color = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Color); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseMedia_Fold_Page( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sType != null) { mySqlScript += "sType,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "sGuidBaseMedia,"; }
            if (this.a_sIssueRange != null) { mySqlScript += "sIssueRange,"; }
            if (this.a_sGuidBaseMedia_Fold != null) { mySqlScript += "sGuidBaseMedia_Fold,"; }
            if (this.a_sNameBaseMedia_Fold != null) { mySqlScript += "sNameBaseMedia_Fold,"; }
            if (this.a_s_NamePage != null) { mySqlScript += "s_NamePage,"; }
            if (this.a_s_XML_Remark != null) { mySqlScript += "s_XML_Remark,"; }
            if (this.a_sCaption != null) { mySqlScript += "sCaption,"; }
            if (this.a_nWidth != null) { mySqlScript += "nWidth,"; }
            if (this.a_nHeight != null) { mySqlScript += "nHeight,"; }
            if (this.a_dClosePage_Plan != null) { mySqlScript += "dClosePage_Plan,"; }
            if (this.a_dClosePage_Actual != null) { mySqlScript += "dClosePage_Actual,"; }
            if (this.a_nAdvertisingAreaMax != null) { mySqlScript += "nAdvertisingAreaMax,"; }
            if (this.a_nWidth_Raphe != null) { mySqlScript += "nWidth_Raphe,"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "sGuidBasePrice_Color,"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "sNameBasePrice_Color,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { mySqlScript += "'" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "'" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_sIssueRange != null) { mySqlScript += "'" + this.a_sIssueRange + "',"; }
            if (this.a_sGuidBaseMedia_Fold != null) { mySqlScript += "'" + this.a_sGuidBaseMedia_Fold + "',"; }
            if (this.a_sNameBaseMedia_Fold != null) { mySqlScript += "'" + this.a_sNameBaseMedia_Fold + "',"; }
            if (this.a_s_NamePage != null) { mySqlScript += "'" + this.a_s_NamePage + "',"; }
            if (this.a_s_XML_Remark != null) { mySqlScript += "'" + this.a_s_XML_Remark + "',"; }
            if (this.a_sCaption != null) { mySqlScript += "'" + this.a_sCaption + "',"; }
            if (this.a_nWidth != null) { mySqlScript += this.a_nWidth + ","; }
            if (this.a_nHeight != null) { mySqlScript += this.a_nHeight + ","; }
            if (this.a_dClosePage_Plan != null) { mySqlScript += "'" + this.a_dClosePage_Plan + "',"; }
            if (this.a_dClosePage_Actual != null) { mySqlScript += "'" + this.a_dClosePage_Actual + "',"; }
            if (this.a_nAdvertisingAreaMax != null) { mySqlScript += this.a_nAdvertisingAreaMax + ","; }
            if (this.a_nWidth_Raphe != null) { mySqlScript += this.a_nWidth_Raphe + ","; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "'" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseMedia_Fold_Page set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { iColumnCount++; mySqlScript += " sType = '" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sGuidBaseMedia != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia = '" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_sIssueRange != null) { iColumnCount++; mySqlScript += " sIssueRange = '" + this.a_sIssueRange + "',"; }
            if (this.a_sGuidBaseMedia_Fold != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia_Fold = '" + this.a_sGuidBaseMedia_Fold + "',"; }
            if (this.a_sNameBaseMedia_Fold != null) { iColumnCount++; mySqlScript += " sNameBaseMedia_Fold = '" + this.a_sNameBaseMedia_Fold + "',"; }
            if (this.a_s_NamePage != null) { iColumnCount++; mySqlScript += " s_NamePage = '" + this.a_s_NamePage + "',"; }
            if (this.a_s_XML_Remark != null) { iColumnCount++; mySqlScript += " s_XML_Remark = '" + this.a_s_XML_Remark + "',"; }
            if (this.a_sCaption != null) { iColumnCount++; mySqlScript += " sCaption = '" + this.a_sCaption + "',"; }
            if (this.a_nWidth != null) { iColumnCount++; mySqlScript += " nWidth = " + this.a_nWidth + ","; }
            if (this.a_nHeight != null) { iColumnCount++; mySqlScript += " nHeight = " + this.a_nHeight + ","; }
            if (this.a_dClosePage_Plan != null) { iColumnCount++; mySqlScript += " dClosePage_Plan = '" + this.a_dClosePage_Plan + "',"; }
            if (this.a_dClosePage_Actual != null) { iColumnCount++; mySqlScript += " dClosePage_Actual = '" + this.a_dClosePage_Actual + "',"; }
            if (this.a_nAdvertisingAreaMax != null) { iColumnCount++; mySqlScript += " nAdvertisingAreaMax = " + this.a_nAdvertisingAreaMax + ","; }
            if (this.a_nWidth_Raphe != null) { iColumnCount++; mySqlScript += " nWidth_Raphe = " + this.a_nWidth_Raphe + ","; }
            if (this.a_sGuidBasePrice_Color != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Color = '" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Color = '" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseMedia_Fold_Page Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //版面的划版信息描述( BaseMedia_Fold_Page_HB )  
    /// <summary>
    /// 版面的划版信息描述
    /// </summary>
    public partial class Sql_BaseMedia_Fold_Page_HB
    {
        #region 与数据表(版面的划版信息描述)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 版面ID 
        /// </summary> 
        public System.String a_sGuidBaseMedia_Fold_Page = null;
        /// <summary> 
        /// 划版用户名 
        /// </summary> 
        public System.String a_s_HB_UserId = null;
        /// <summary> 
        /// 划版标记区 
        /// </summary> 
        public System.String a_s_HB_remarkArea = null;
        /// <summary> 
        /// 保留区 
        /// </summary> 
        public System.String a_s_HB_reservedarea = null;
        /// <summary> 
        /// XML标记 
        /// </summary> 
        public System.String a_s_HB_xml_Remark = null;
        /// <summary> 
        /// 版面日期 
        /// </summary> 
        public System.DateTime? a_dPageDateTime = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseMedia_Fold_Page != null) { this.a_sGuidBaseMedia_Fold_Page = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia_Fold_Page); }
            if (this.a_s_HB_UserId != null) { this.a_s_HB_UserId = ReplaceString.GetReplaceString(this.a_s_HB_UserId); }
            if (this.a_s_HB_remarkArea != null) { this.a_s_HB_remarkArea = ReplaceString.GetReplaceString(this.a_s_HB_remarkArea); }
            if (this.a_s_HB_reservedarea != null) { this.a_s_HB_reservedarea = ReplaceString.GetReplaceString(this.a_s_HB_reservedarea); }
            if (this.a_s_HB_xml_Remark != null) { this.a_s_HB_xml_Remark = ReplaceString.GetReplaceString(this.a_s_HB_xml_Remark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseMedia_Fold_Page_HB( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBaseMedia_Fold_Page != null) { mySqlScript += "sGuidBaseMedia_Fold_Page,"; }
            if (this.a_s_HB_UserId != null) { mySqlScript += "s_HB_UserId,"; }
            if (this.a_s_HB_remarkArea != null) { mySqlScript += "s_HB_remarkArea,"; }
            if (this.a_s_HB_reservedarea != null) { mySqlScript += "s_HB_reservedarea,"; }
            if (this.a_s_HB_xml_Remark != null) { mySqlScript += "s_HB_xml_Remark,"; }
            if (this.a_dPageDateTime != null) { mySqlScript += "dPageDateTime,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBaseMedia_Fold_Page != null) { mySqlScript += "'" + this.a_sGuidBaseMedia_Fold_Page + "',"; }
            if (this.a_s_HB_UserId != null) { mySqlScript += "'" + this.a_s_HB_UserId + "',"; }
            if (this.a_s_HB_remarkArea != null) { mySqlScript += "'" + this.a_s_HB_remarkArea + "',"; }
            if (this.a_s_HB_reservedarea != null) { mySqlScript += "'" + this.a_s_HB_reservedarea + "',"; }
            if (this.a_s_HB_xml_Remark != null) { mySqlScript += "'" + this.a_s_HB_xml_Remark + "',"; }
            if (this.a_dPageDateTime != null) { mySqlScript += "'" + this.a_dPageDateTime + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseMedia_Fold_Page_HB set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBaseMedia_Fold_Page != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia_Fold_Page = '" + this.a_sGuidBaseMedia_Fold_Page + "',"; }
            if (this.a_s_HB_UserId != null) { iColumnCount++; mySqlScript += " s_HB_UserId = '" + this.a_s_HB_UserId + "',"; }
            if (this.a_s_HB_remarkArea != null) { iColumnCount++; mySqlScript += " s_HB_remarkArea = '" + this.a_s_HB_remarkArea + "',"; }
            if (this.a_s_HB_reservedarea != null) { iColumnCount++; mySqlScript += " s_HB_reservedarea = '" + this.a_s_HB_reservedarea + "',"; }
            if (this.a_s_HB_xml_Remark != null) { iColumnCount++; mySqlScript += " s_HB_xml_Remark = '" + this.a_s_HB_xml_Remark + "',"; }
            if (this.a_dPageDateTime != null) { iColumnCount++; mySqlScript += " dPageDateTime = '" + this.a_dPageDateTime + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseMedia_Fold_Page_HB Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //期刊刊期( BaseMedia_Periodical_Issue )  
    /// <summary>
    /// 期刊刊期
    /// </summary>
    public partial class Sql_BaseMedia_Periodical_Issue
    {
        #region 与数据表(期刊刊期)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 媒体ID 
        /// </summary> 
        public System.String a_sGuidBaseMedia = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 日期 
        /// </summary> 
        public System.DateTime? a_dDate = null;
        /// <summary> 
        /// 期号 
        /// </summary> 
        public System.Int32? a_iIssue = null;
        /// <summary> 
        /// 总期号 
        /// </summary> 
        public System.Int32? a_iIssue_All = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseMedia != null) { this.a_sGuidBaseMedia = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseMedia_Periodical_Issue( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "sGuidBaseMedia,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_dDate != null) { mySqlScript += "dDate,"; }
            if (this.a_iIssue != null) { mySqlScript += "iIssue,"; }
            if (this.a_iIssue_All != null) { mySqlScript += "iIssue_All,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "'" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_dDate != null) { mySqlScript += "'" + this.a_dDate + "',"; }
            if (this.a_iIssue != null) { mySqlScript += this.a_iIssue + ","; }
            if (this.a_iIssue_All != null) { mySqlScript += this.a_iIssue_All + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseMedia_Periodical_Issue set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseMedia != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia = '" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_dDate != null) { iColumnCount++; mySqlScript += " dDate = '" + this.a_dDate + "',"; }
            if (this.a_iIssue != null) { iColumnCount++; mySqlScript += " iIssue = " + this.a_iIssue + ","; }
            if (this.a_iIssue_All != null) { iColumnCount++; mySqlScript += " iIssue_All = " + this.a_iIssue_All + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseMedia_Periodical_Issue Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //价格表(面积/分类)( BaseMedia_PriceTable )  
    /// <summary>
    /// 价格表(面积/分类)
    /// </summary>
    public partial class Sql_BaseMedia_PriceTable
    {
        #region 与数据表(价格表(面积/分类))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 媒体ID 
        /// </summary> 
        public System.String a_sGuidBaseMedia = null;
        /// <summary> 
        /// 媒体 
        /// </summary> 
        public System.String a_sNameBaseMedia = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 默认 
        /// </summary> 
        public System.Boolean? a_bDefault = null;
        /// <summary> 
        /// 开始日期 
        /// </summary> 
        public System.DateTime? a_dStartDate = null;
        /// <summary> 
        /// 结束日期 
        /// </summary> 
        public System.DateTime? a_dEndDate = null;
        /// <summary> 
        /// 限制使用日期 
        /// </summary> 
        public System.Boolean? a_bLimitDate = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseMedia != null) { this.a_sGuidBaseMedia = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia); }
            if (this.a_sNameBaseMedia != null) { this.a_sNameBaseMedia = ReplaceString.GetReplaceString(this.a_sNameBaseMedia); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseMedia_PriceTable( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "sGuidBaseMedia,"; }
            if (this.a_sNameBaseMedia != null) { mySqlScript += "sNameBaseMedia,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bDefault != null) { mySqlScript += "bDefault,"; }
            if (this.a_dStartDate != null) { mySqlScript += "dStartDate,"; }
            if (this.a_dEndDate != null) { mySqlScript += "dEndDate,"; }
            if (this.a_bLimitDate != null) { mySqlScript += "bLimitDate,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "'" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_sNameBaseMedia != null) { mySqlScript += "'" + this.a_sNameBaseMedia + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bDefault != null) { mySqlScript += "'" + this.a_bDefault + "',"; }
            if (this.a_dStartDate != null) { mySqlScript += "'" + this.a_dStartDate + "',"; }
            if (this.a_dEndDate != null) { mySqlScript += "'" + this.a_dEndDate + "',"; }
            if (this.a_bLimitDate != null) { mySqlScript += "'" + this.a_bLimitDate + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseMedia_PriceTable set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseMedia != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia = '" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_sNameBaseMedia != null) { iColumnCount++; mySqlScript += " sNameBaseMedia = '" + this.a_sNameBaseMedia + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bDefault != null) { iColumnCount++; mySqlScript += " bDefault = '" + this.a_bDefault + "',"; }
            if (this.a_dStartDate != null) { iColumnCount++; mySqlScript += " dStartDate = '" + this.a_dStartDate + "',"; }
            if (this.a_dEndDate != null) { iColumnCount++; mySqlScript += " dEndDate = '" + this.a_dEndDate + "',"; }
            if (this.a_bLimitDate != null) { iColumnCount++; mySqlScript += " bLimitDate = '" + this.a_bLimitDate + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseMedia_PriceTable Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //面积广告价格(含分类小面积)( BaseMedia_PriceTable_Area_Price )  
    /// <summary>
    /// 面积广告价格(含分类小面积)
    /// </summary>
    public partial class Sql_BaseMedia_PriceTable_Area_Price
    {
        #region 与数据表(面积广告价格(含分类小面积))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 类型(面积/分类) 
        /// </summary> 
        public System.String a_sType = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 价格表 
        /// </summary> 
        public System.String a_sGuidBaseMedia_PriceTable = null;
        /// <summary> 
        /// 规格ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_Specification = null;
        /// <summary> 
        /// 规格 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_Specification = null;
        /// <summary> 
        /// 色彩ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Color = null;
        /// <summary> 
        /// 色彩 
        /// </summary> 
        public System.String a_sNameBasePrice_Color = null;
        /// <summary> 
        /// 内容类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_ContentType = null;
        /// <summary> 
        /// 内容类别 
        /// </summary> 
        public System.String a_sNameBasePrice_ContentType = null;
        /// <summary> 
        /// 星期ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Week = null;
        /// <summary> 
        /// 星期 
        /// </summary> 
        public System.String a_sNameBasePrice_Week = null;
        /// <summary> 
        /// 版位类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 版位类别 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 叠次ID 
        /// </summary> 
        public System.String a_sGuidBaseMedia_Fold = null;
        /// <summary> 
        /// 叠次 
        /// </summary> 
        public System.String a_sNameBaseMedia_Fold = null;
        /// <summary> 
        /// 标准价格 
        /// </summary> 
        public System.Double? a_nPrice = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sType != null) { this.a_sType = ReplaceString.GetReplaceString(this.a_sType); }
            if (this.a_sGuidBaseMedia_PriceTable != null) { this.a_sGuidBaseMedia_PriceTable = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia_PriceTable); }
            if (this.a_sGuidBasePrice_Media_Specification != null) { this.a_sGuidBasePrice_Media_Specification = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_Specification); }
            if (this.a_sNameBasePrice_Media_Specification != null) { this.a_sNameBasePrice_Media_Specification = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_Specification); }
            if (this.a_sGuidBasePrice_Color != null) { this.a_sGuidBasePrice_Color = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Color); }
            if (this.a_sNameBasePrice_Color != null) { this.a_sNameBasePrice_Color = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Color); }
            if (this.a_sGuidBasePrice_ContentType != null) { this.a_sGuidBasePrice_ContentType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_ContentType); }
            if (this.a_sNameBasePrice_ContentType != null) { this.a_sNameBasePrice_ContentType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_ContentType); }
            if (this.a_sGuidBasePrice_Week != null) { this.a_sGuidBasePrice_Week = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Week); }
            if (this.a_sNameBasePrice_Week != null) { this.a_sNameBasePrice_Week = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Week); }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { this.a_sGuidBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_PagePositionType); }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { this.a_sNameBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_PagePositionType); }
            if (this.a_sGuidBaseMedia_Fold != null) { this.a_sGuidBaseMedia_Fold = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia_Fold); }
            if (this.a_sNameBaseMedia_Fold != null) { this.a_sNameBaseMedia_Fold = ReplaceString.GetReplaceString(this.a_sNameBaseMedia_Fold); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseMedia_PriceTable_Area_Price( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sType != null) { mySqlScript += "sType,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sGuidBaseMedia_PriceTable != null) { mySqlScript += "sGuidBaseMedia_PriceTable,"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { mySqlScript += "sGuidBasePrice_Media_Specification,"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { mySqlScript += "sNameBasePrice_Media_Specification,"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "sGuidBasePrice_Color,"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "sNameBasePrice_Color,"; }
            if (this.a_sGuidBasePrice_ContentType != null) { mySqlScript += "sGuidBasePrice_ContentType,"; }
            if (this.a_sNameBasePrice_ContentType != null) { mySqlScript += "sNameBasePrice_ContentType,"; }
            if (this.a_sGuidBasePrice_Week != null) { mySqlScript += "sGuidBasePrice_Week,"; }
            if (this.a_sNameBasePrice_Week != null) { mySqlScript += "sNameBasePrice_Week,"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "sGuidBasePrice_Media_PagePositionType,"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "sNameBasePrice_Media_PagePositionType,"; }
            if (this.a_sGuidBaseMedia_Fold != null) { mySqlScript += "sGuidBaseMedia_Fold,"; }
            if (this.a_sNameBaseMedia_Fold != null) { mySqlScript += "sNameBaseMedia_Fold,"; }
            if (this.a_nPrice != null) { mySqlScript += "nPrice,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { mySqlScript += "'" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sGuidBaseMedia_PriceTable != null) { mySqlScript += "'" + this.a_sGuidBaseMedia_PriceTable + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_Specification + "',"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_Specification + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "'" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBasePrice_ContentType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_ContentType + "',"; }
            if (this.a_sNameBasePrice_ContentType != null) { mySqlScript += "'" + this.a_sNameBasePrice_ContentType + "',"; }
            if (this.a_sGuidBasePrice_Week != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Week + "',"; }
            if (this.a_sNameBasePrice_Week != null) { mySqlScript += "'" + this.a_sNameBasePrice_Week + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBaseMedia_Fold != null) { mySqlScript += "'" + this.a_sGuidBaseMedia_Fold + "',"; }
            if (this.a_sNameBaseMedia_Fold != null) { mySqlScript += "'" + this.a_sNameBaseMedia_Fold + "',"; }
            if (this.a_nPrice != null) { mySqlScript += this.a_nPrice + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseMedia_PriceTable_Area_Price set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { iColumnCount++; mySqlScript += " sType = '" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sGuidBaseMedia_PriceTable != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia_PriceTable = '" + this.a_sGuidBaseMedia_PriceTable + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_Specification = '" + this.a_sGuidBasePrice_Media_Specification + "',"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_Specification = '" + this.a_sNameBasePrice_Media_Specification + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Color = '" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Color = '" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_ContentType = '" + this.a_sGuidBasePrice_ContentType + "',"; }
            if (this.a_sNameBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_ContentType = '" + this.a_sNameBasePrice_ContentType + "',"; }
            if (this.a_sGuidBasePrice_Week != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Week = '" + this.a_sGuidBasePrice_Week + "',"; }
            if (this.a_sNameBasePrice_Week != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Week = '" + this.a_sNameBasePrice_Week + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_PagePositionType = '" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_PagePositionType = '" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBaseMedia_Fold != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia_Fold = '" + this.a_sGuidBaseMedia_Fold + "',"; }
            if (this.a_sNameBaseMedia_Fold != null) { iColumnCount++; mySqlScript += " sNameBaseMedia_Fold = '" + this.a_sNameBaseMedia_Fold + "',"; }
            if (this.a_nPrice != null) { iColumnCount++; mySqlScript += " nPrice = " + this.a_nPrice + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseMedia_PriceTable_Area_Price Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //分类广告价格(分类小面积在面积里面设置)( BaseMedia_PriceTable_Categories_Price )  
    /// <summary>
    /// 分类广告价格(分类小面积在面积里面设置)
    /// </summary>
    public partial class Sql_BaseMedia_PriceTable_Categories_Price
    {
        #region 与数据表(分类广告价格(分类小面积在面积里面设置))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 价格表 
        /// </summary> 
        public System.String a_sGuidBaseMedia_PriceTable = null;
        /// <summary> 
        /// 计价规则类型(正文/标题) 
        /// </summary> 
        public System.String a_sPriceRulesType = null;
        /// <summary> 
        /// 计价标准(按字/按行/按则/按格/按面积) 
        /// </summary> 
        public System.String a_sPriceStandard = null;
        /// <summary> 
        /// 色彩ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Color = null;
        /// <summary> 
        /// 色彩 
        /// </summary> 
        public System.String a_sNameBasePrice_Color = null;
        /// <summary> 
        /// 内容类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_ContentType = null;
        /// <summary> 
        /// 内容类别 
        /// </summary> 
        public System.String a_sNameBasePrice_ContentType = null;
        /// <summary> 
        /// 星期ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Week = null;
        /// <summary> 
        /// 星期 
        /// </summary> 
        public System.String a_sNameBasePrice_Week = null;
        /// <summary> 
        /// 版位类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 版位类别 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 价格 
        /// </summary> 
        public System.Double? a_nPrice = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseMedia_PriceTable != null) { this.a_sGuidBaseMedia_PriceTable = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia_PriceTable); }
            if (this.a_sPriceRulesType != null) { this.a_sPriceRulesType = ReplaceString.GetReplaceString(this.a_sPriceRulesType); }
            if (this.a_sPriceStandard != null) { this.a_sPriceStandard = ReplaceString.GetReplaceString(this.a_sPriceStandard); }
            if (this.a_sGuidBasePrice_Color != null) { this.a_sGuidBasePrice_Color = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Color); }
            if (this.a_sNameBasePrice_Color != null) { this.a_sNameBasePrice_Color = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Color); }
            if (this.a_sGuidBasePrice_ContentType != null) { this.a_sGuidBasePrice_ContentType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_ContentType); }
            if (this.a_sNameBasePrice_ContentType != null) { this.a_sNameBasePrice_ContentType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_ContentType); }
            if (this.a_sGuidBasePrice_Week != null) { this.a_sGuidBasePrice_Week = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Week); }
            if (this.a_sNameBasePrice_Week != null) { this.a_sNameBasePrice_Week = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Week); }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { this.a_sGuidBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_PagePositionType); }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { this.a_sNameBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_PagePositionType); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseMedia_PriceTable_Categories_Price( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sGuidBaseMedia_PriceTable != null) { mySqlScript += "sGuidBaseMedia_PriceTable,"; }
            if (this.a_sPriceRulesType != null) { mySqlScript += "sPriceRulesType,"; }
            if (this.a_sPriceStandard != null) { mySqlScript += "sPriceStandard,"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "sGuidBasePrice_Color,"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "sNameBasePrice_Color,"; }
            if (this.a_sGuidBasePrice_ContentType != null) { mySqlScript += "sGuidBasePrice_ContentType,"; }
            if (this.a_sNameBasePrice_ContentType != null) { mySqlScript += "sNameBasePrice_ContentType,"; }
            if (this.a_sGuidBasePrice_Week != null) { mySqlScript += "sGuidBasePrice_Week,"; }
            if (this.a_sNameBasePrice_Week != null) { mySqlScript += "sNameBasePrice_Week,"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "sGuidBasePrice_Media_PagePositionType,"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "sNameBasePrice_Media_PagePositionType,"; }
            if (this.a_nPrice != null) { mySqlScript += "nPrice,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sGuidBaseMedia_PriceTable != null) { mySqlScript += "'" + this.a_sGuidBaseMedia_PriceTable + "',"; }
            if (this.a_sPriceRulesType != null) { mySqlScript += "'" + this.a_sPriceRulesType + "',"; }
            if (this.a_sPriceStandard != null) { mySqlScript += "'" + this.a_sPriceStandard + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "'" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBasePrice_ContentType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_ContentType + "',"; }
            if (this.a_sNameBasePrice_ContentType != null) { mySqlScript += "'" + this.a_sNameBasePrice_ContentType + "',"; }
            if (this.a_sGuidBasePrice_Week != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Week + "',"; }
            if (this.a_sNameBasePrice_Week != null) { mySqlScript += "'" + this.a_sNameBasePrice_Week + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_nPrice != null) { mySqlScript += this.a_nPrice + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseMedia_PriceTable_Categories_Price set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sGuidBaseMedia_PriceTable != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia_PriceTable = '" + this.a_sGuidBaseMedia_PriceTable + "',"; }
            if (this.a_sPriceRulesType != null) { iColumnCount++; mySqlScript += " sPriceRulesType = '" + this.a_sPriceRulesType + "',"; }
            if (this.a_sPriceStandard != null) { iColumnCount++; mySqlScript += " sPriceStandard = '" + this.a_sPriceStandard + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Color = '" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Color = '" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_ContentType = '" + this.a_sGuidBasePrice_ContentType + "',"; }
            if (this.a_sNameBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_ContentType = '" + this.a_sNameBasePrice_ContentType + "',"; }
            if (this.a_sGuidBasePrice_Week != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Week = '" + this.a_sGuidBasePrice_Week + "',"; }
            if (this.a_sNameBasePrice_Week != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Week = '" + this.a_sNameBasePrice_Week + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_PagePositionType = '" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_PagePositionType = '" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_nPrice != null) { iColumnCount++; mySqlScript += " nPrice = " + this.a_nPrice + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseMedia_PriceTable_Categories_Price Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //分类广告计价规则(除小面积外_小面积在规则里面设置)( BaseMedia_PriceTable_Categories_Rules )  
    /// <summary>
    /// 分类广告计价规则(除小面积外_小面积在规则里面设置)
    /// </summary>
    public partial class Sql_BaseMedia_PriceTable_Categories_Rules
    {
        #region 与数据表(分类广告计价规则(除小面积外_小面积在规则里面设置))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 价格表 
        /// </summary> 
        public System.String a_sGuidBaseMedia_PriceTable = null;
        /// <summary> 
        /// 计价规则类型(正文/标题) 
        /// </summary> 
        public System.String a_sPriceRulesType = null;
        /// <summary> 
        /// 计价标准(按字/按行/按则/按格/按面积) 
        /// </summary> 
        public System.String a_sPriceStandard = null;
        /// <summary> 
        /// 是否和色彩有关 
        /// </summary> 
        public System.Boolean? a_bBasePrice_Color = null;
        /// <summary> 
        /// 是否和版位类别有关 
        /// </summary> 
        public System.Boolean? a_bBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 是否和内容类别有关 
        /// </summary> 
        public System.Boolean? a_bBasePrice_ContentType = null;
        /// <summary> 
        /// 是否和星期有关 
        /// </summary> 
        public System.Boolean? a_bBasePrice_Week = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseMedia_PriceTable != null) { this.a_sGuidBaseMedia_PriceTable = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia_PriceTable); }
            if (this.a_sPriceRulesType != null) { this.a_sPriceRulesType = ReplaceString.GetReplaceString(this.a_sPriceRulesType); }
            if (this.a_sPriceStandard != null) { this.a_sPriceStandard = ReplaceString.GetReplaceString(this.a_sPriceStandard); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseMedia_PriceTable_Categories_Rules( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sGuidBaseMedia_PriceTable != null) { mySqlScript += "sGuidBaseMedia_PriceTable,"; }
            if (this.a_sPriceRulesType != null) { mySqlScript += "sPriceRulesType,"; }
            if (this.a_sPriceStandard != null) { mySqlScript += "sPriceStandard,"; }
            if (this.a_bBasePrice_Color != null) { mySqlScript += "bBasePrice_Color,"; }
            if (this.a_bBasePrice_Media_PagePositionType != null) { mySqlScript += "bBasePrice_Media_PagePositionType,"; }
            if (this.a_bBasePrice_ContentType != null) { mySqlScript += "bBasePrice_ContentType,"; }
            if (this.a_bBasePrice_Week != null) { mySqlScript += "bBasePrice_Week,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sGuidBaseMedia_PriceTable != null) { mySqlScript += "'" + this.a_sGuidBaseMedia_PriceTable + "',"; }
            if (this.a_sPriceRulesType != null) { mySqlScript += "'" + this.a_sPriceRulesType + "',"; }
            if (this.a_sPriceStandard != null) { mySqlScript += "'" + this.a_sPriceStandard + "',"; }
            if (this.a_bBasePrice_Color != null) { mySqlScript += "'" + this.a_bBasePrice_Color + "',"; }
            if (this.a_bBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_bBasePrice_Media_PagePositionType + "',"; }
            if (this.a_bBasePrice_ContentType != null) { mySqlScript += "'" + this.a_bBasePrice_ContentType + "',"; }
            if (this.a_bBasePrice_Week != null) { mySqlScript += "'" + this.a_bBasePrice_Week + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseMedia_PriceTable_Categories_Rules set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sGuidBaseMedia_PriceTable != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia_PriceTable = '" + this.a_sGuidBaseMedia_PriceTable + "',"; }
            if (this.a_sPriceRulesType != null) { iColumnCount++; mySqlScript += " sPriceRulesType = '" + this.a_sPriceRulesType + "',"; }
            if (this.a_sPriceStandard != null) { iColumnCount++; mySqlScript += " sPriceStandard = '" + this.a_sPriceStandard + "',"; }
            if (this.a_bBasePrice_Color != null) { iColumnCount++; mySqlScript += " bBasePrice_Color = '" + this.a_bBasePrice_Color + "',"; }
            if (this.a_bBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " bBasePrice_Media_PagePositionType = '" + this.a_bBasePrice_Media_PagePositionType + "',"; }
            if (this.a_bBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " bBasePrice_ContentType = '" + this.a_bBasePrice_ContentType + "',"; }
            if (this.a_bBasePrice_Week != null) { iColumnCount++; mySqlScript += " bBasePrice_Week = '" + this.a_bBasePrice_Week + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseMedia_PriceTable_Categories_Rules Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //广告类型(面积1/面积2/分类/专栏/...)( BaseOrder_AdvertisingType )  
    /// <summary>
    /// 广告类型(面积1/面积2/分类/专栏/...)
    /// </summary>
    public partial class Sql_BaseOrder_AdvertisingType
    {
        #region 与数据表(广告类型(面积1/面积2/分类/专栏/...))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 类型(面积广告/分类广告/其它) 
        /// </summary> 
        public System.String a_sType = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sType != null) { this.a_sType = ReplaceString.GetReplaceString(this.a_sType); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseOrder_AdvertisingType( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sType != null) { mySqlScript += "sType,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { mySqlScript += "'" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseOrder_AdvertisingType set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { iColumnCount++; mySqlScript += " sType = '" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseOrder_AdvertisingType Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //来稿方式( BaseOrder_ArrivalManuscriptMode )  
    /// <summary>
    /// 来稿方式
    /// </summary>
    public partial class Sql_BaseOrder_ArrivalManuscriptMode
    {
        #region 与数据表(来稿方式)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseOrder_ArrivalManuscriptMode( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseOrder_ArrivalManuscriptMode set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseOrder_ArrivalManuscriptMode Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //业务类型(上门/业务员/代理公司)( BaseOrder_BusinessMode )  
    /// <summary>
    /// 业务类型(上门/业务员/代理公司)
    /// </summary>
    public partial class Sql_BaseOrder_BusinessMode
    {
        #region 与数据表(业务类型(上门/业务员/代理公司))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseOrder_BusinessMode( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseOrder_BusinessMode set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseOrder_BusinessMode Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //商业类型(商业广告/公益广告/公关广告/分类广告) 日报用( BaseOrder_BusinessType )  
    /// <summary>
    /// 商业类型(商业广告/公益广告/公关广告/分类广告) 日报用
    /// </summary>
    public partial class Sql_BaseOrder_BusinessType
    {
        #region 与数据表(商业类型(商业广告/公益广告/公关广告/分类广告) 日报用)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseOrder_BusinessType( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseOrder_BusinessType set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseOrder_BusinessType Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //行业( BaseOrder_Industry )  
    /// <summary>
    /// 行业
    /// </summary>
    public partial class Sql_BaseOrder_Industry
    {
        #region 与数据表(行业)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 父级ID 
        /// </summary> 
        public System.String a_sGuidParent = null;
        /// <summary> 
        /// 层级 
        /// </summary> 
        public System.Int32? a_iDepth = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sGuidParent != null) { this.a_sGuidParent = ReplaceString.GetReplaceString(this.a_sGuidParent); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseOrder_Industry( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sGuidParent != null) { mySqlScript += "sGuidParent,"; }
            if (this.a_iDepth != null) { mySqlScript += "iDepth,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sGuidParent != null) { mySqlScript += "'" + this.a_sGuidParent + "',"; }
            if (this.a_iDepth != null) { mySqlScript += this.a_iDepth + ","; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseOrder_Industry set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sGuidParent != null) { iColumnCount++; mySqlScript += " sGuidParent = '" + this.a_sGuidParent + "',"; }
            if (this.a_iDepth != null) { iColumnCount++; mySqlScript += " iDepth = " + this.a_iDepth + ","; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseOrder_Industry Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //长单类型( BaseOrder_LongOrderType )  
    /// <summary>
    /// 长单类型
    /// </summary>
    public partial class Sql_BaseOrder_LongOrderType
    {
        #region 与数据表(长单类型)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 类型(期数/金额) 
        /// </summary> 
        public System.String a_sType = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 数值 
        /// </summary> 
        public System.String a_sValue = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sType != null) { this.a_sType = ReplaceString.GetReplaceString(this.a_sType); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sValue != null) { this.a_sValue = ReplaceString.GetReplaceString(this.a_sValue); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseOrder_LongOrderType( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sType != null) { mySqlScript += "sType,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sValue != null) { mySqlScript += "sValue,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { mySqlScript += "'" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sValue != null) { mySqlScript += "'" + this.a_sValue + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseOrder_LongOrderType set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { iColumnCount++; mySqlScript += " sType = '" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sValue != null) { iColumnCount++; mySqlScript += " sValue = '" + this.a_sValue + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseOrder_LongOrderType Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //版位(日报加的 是多级的)( BaseOrder_PagePosition )  
    /// <summary>
    /// 版位(日报加的 是多级的)
    /// </summary>
    public partial class Sql_BaseOrder_PagePosition
    {
        #region 与数据表(版位(日报加的 是多级的))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 父级ID 
        /// </summary> 
        public System.String a_sGuidParent = null;
        /// <summary> 
        /// 层级 
        /// </summary> 
        public System.Int32? a_iDepth = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sGuidParent != null) { this.a_sGuidParent = ReplaceString.GetReplaceString(this.a_sGuidParent); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseOrder_PagePosition( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sGuidParent != null) { mySqlScript += "sGuidParent,"; }
            if (this.a_iDepth != null) { mySqlScript += "iDepth,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sGuidParent != null) { mySqlScript += "'" + this.a_sGuidParent + "',"; }
            if (this.a_iDepth != null) { mySqlScript += this.a_iDepth + ","; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseOrder_PagePosition set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sGuidParent != null) { iColumnCount++; mySqlScript += " sGuidParent = '" + this.a_sGuidParent + "',"; }
            if (this.a_iDepth != null) { iColumnCount++; mySqlScript += " iDepth = " + this.a_iDepth + ","; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseOrder_PagePosition Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //收款类型(免费/物抵/互换/内部/公益等)( BaseOrder_PaymentType )  
    /// <summary>
    /// 收款类型(免费/物抵/互换/内部/公益等)
    /// </summary>
    public partial class Sql_BaseOrder_PaymentType
    {
        #region 与数据表(收款类型(免费/物抵/互换/内部/公益等))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 属于正常 
        /// </summary> 
        public System.Boolean? a_bNormal = null;
        /// <summary> 
        /// 属于免费 
        /// </summary> 
        public System.Boolean? a_bFree = null;
        /// <summary> 
        /// 计算欠款处罚 
        /// </summary> 
        public System.Boolean? a_bCalculateArrearsPunishment = null;
        /// <summary> 
        /// 计算佣金 
        /// </summary> 
        public System.Boolean? a_bCalculateCommission = null;
        /// <summary> 
        /// 默认 
        /// </summary> 
        public System.Boolean? a_bDefault = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseOrder_PaymentType( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bNormal != null) { mySqlScript += "bNormal,"; }
            if (this.a_bFree != null) { mySqlScript += "bFree,"; }
            if (this.a_bCalculateArrearsPunishment != null) { mySqlScript += "bCalculateArrearsPunishment,"; }
            if (this.a_bCalculateCommission != null) { mySqlScript += "bCalculateCommission,"; }
            if (this.a_bDefault != null) { mySqlScript += "bDefault,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bNormal != null) { mySqlScript += "'" + this.a_bNormal + "',"; }
            if (this.a_bFree != null) { mySqlScript += "'" + this.a_bFree + "',"; }
            if (this.a_bCalculateArrearsPunishment != null) { mySqlScript += "'" + this.a_bCalculateArrearsPunishment + "',"; }
            if (this.a_bCalculateCommission != null) { mySqlScript += "'" + this.a_bCalculateCommission + "',"; }
            if (this.a_bDefault != null) { mySqlScript += "'" + this.a_bDefault + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseOrder_PaymentType set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bNormal != null) { iColumnCount++; mySqlScript += " bNormal = '" + this.a_bNormal + "',"; }
            if (this.a_bFree != null) { iColumnCount++; mySqlScript += " bFree = '" + this.a_bFree + "',"; }
            if (this.a_bCalculateArrearsPunishment != null) { iColumnCount++; mySqlScript += " bCalculateArrearsPunishment = '" + this.a_bCalculateArrearsPunishment + "',"; }
            if (this.a_bCalculateCommission != null) { iColumnCount++; mySqlScript += " bCalculateCommission = '" + this.a_bCalculateCommission + "',"; }
            if (this.a_bDefault != null) { iColumnCount++; mySqlScript += " bDefault = '" + this.a_bDefault + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseOrder_PaymentType Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //赠送政策( BaseOrder_Present )  
    /// <summary>
    /// 赠送政策
    /// </summary>
    public partial class Sql_BaseOrder_Present
    {
        #region 与数据表(赠送政策)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 购买数量 
        /// </summary> 
        public System.Int32? a_iBuyQuantity = null;
        /// <summary> 
        /// 赠送数量 
        /// </summary> 
        public System.Int32? a_iPresentQuantity = null;
        /// <summary> 
        /// 是否有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseOrder_Present( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_iBuyQuantity != null) { mySqlScript += "iBuyQuantity,"; }
            if (this.a_iPresentQuantity != null) { mySqlScript += "iPresentQuantity,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_iBuyQuantity != null) { mySqlScript += this.a_iBuyQuantity + ","; }
            if (this.a_iPresentQuantity != null) { mySqlScript += this.a_iPresentQuantity + ","; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseOrder_Present set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_iBuyQuantity != null) { iColumnCount++; mySqlScript += " iBuyQuantity = " + this.a_iBuyQuantity + ","; }
            if (this.a_iPresentQuantity != null) { iColumnCount++; mySqlScript += " iPresentQuantity = " + this.a_iPresentQuantity + ","; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseOrder_Present Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //广告项目(非广告项目/社庆项目/公务员评选项目_日报用)( BaseOrder_Project )  
    /// <summary>
    /// 广告项目(非广告项目/社庆项目/公务员评选项目_日报用)
    /// </summary>
    public partial class Sql_BaseOrder_Project
    {
        #region 与数据表(广告项目(非广告项目/社庆项目/公务员评选项目_日报用))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseOrder_Project( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseOrder_Project set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseOrder_Project Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //广告地区( BaseOrder_Region )  
    /// <summary>
    /// 广告地区
    /// </summary>
    public partial class Sql_BaseOrder_Region
    {
        #region 与数据表(广告地区)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseOrder_Region( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseOrder_Region set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseOrder_Region Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //广告来源( BaseOrder_Source )  
    /// <summary>
    /// 广告来源
    /// </summary>
    public partial class Sql_BaseOrder_Source
    {
        #region 与数据表(广告来源)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 父级ID 
        /// </summary> 
        public System.String a_sGuidParent = null;
        /// <summary> 
        /// 层级 
        /// </summary> 
        public System.Int32? a_iDepth = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sGuidParent != null) { this.a_sGuidParent = ReplaceString.GetReplaceString(this.a_sGuidParent); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseOrder_Source( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sGuidParent != null) { mySqlScript += "sGuidParent,"; }
            if (this.a_iDepth != null) { mySqlScript += "iDepth,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sGuidParent != null) { mySqlScript += "'" + this.a_sGuidParent + "',"; }
            if (this.a_iDepth != null) { mySqlScript += this.a_iDepth + ","; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseOrder_Source set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sGuidParent != null) { iColumnCount++; mySqlScript += " sGuidParent = '" + this.a_sGuidParent + "',"; }
            if (this.a_iDepth != null) { iColumnCount++; mySqlScript += " iDepth = " + this.a_iDepth + ","; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseOrder_Source Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //色彩( BasePrice_Color )  
    /// <summary>
    /// 色彩
    /// </summary>
    public partial class Sql_BasePrice_Color
    {
        #region 与数据表(色彩)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 是否有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BasePrice_Color( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BasePrice_Color set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BasePrice_Color Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //内容类别( BasePrice_ContentType )  
    /// <summary>
    /// 内容类别
    /// </summary>
    public partial class Sql_BasePrice_ContentType
    {
        #region 与数据表(内容类别)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BasePrice_ContentType( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BasePrice_ContentType set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BasePrice_ContentType Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //版位类型( BasePrice_Media_PagePositionType )  
    /// <summary>
    /// 版位类型
    /// </summary>
    public partial class Sql_BasePrice_Media_PagePositionType
    {
        #region 与数据表(版位类型)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 媒体 
        /// </summary> 
        public System.String a_sGuidBaseMedia = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseMedia != null) { this.a_sGuidBaseMedia = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BasePrice_Media_PagePositionType( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "sGuidBaseMedia,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "'" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BasePrice_Media_PagePositionType set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseMedia != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia = '" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BasePrice_Media_PagePositionType Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //版位类别包含的版面( BasePrice_Media_PagePositionType_Fold_Page )  
    /// <summary>
    /// 版位类别包含的版面
    /// </summary>
    public partial class Sql_BasePrice_Media_PagePositionType_Fold_Page
    {
        #region 与数据表(版位类别包含的版面)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BasePrice_Media_PagePositionType_Fold_Page( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BasePrice_Media_PagePositionType_Fold_Page set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BasePrice_Media_PagePositionType_Fold_Page Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //广告规格( BasePrice_Media_Specification )  
    /// <summary>
    /// 广告规格
    /// </summary>
    public partial class Sql_BasePrice_Media_Specification
    {
        #region 与数据表(广告规格)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 媒体 
        /// </summary> 
        public System.String a_sGuidBaseMedia = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 类型(面积广告/分类广告/其它) 
        /// </summary> 
        public System.String a_sType = null;
        /// <summary> 
        /// 计价标准(按字/按行/按则/按格/按面积) 
        /// </summary> 
        public System.String a_sPriceStandard = null;
        /// <summary> 
        /// 宽度 
        /// </summary> 
        public System.Double? a_nWidth = null;
        /// <summary> 
        /// 高度 
        /// </summary> 
        public System.Double? a_nHeight = null;
        /// <summary> 
        /// 面积 
        /// </summary> 
        public System.Double? a_nArea = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        /// <summary> 
        /// 是中缝 
        /// </summary> 
        public System.Boolean? a_bIsRaphe = null;
        /// <summary> 
        /// 宽度可独立变化 
        /// </summary> 
        public System.Boolean? a_bCanOnlyChange_Width = null;
        /// <summary> 
        /// 高度可独立变化 
        /// </summary> 
        public System.Boolean? a_bCanOnlyChange_Height = null;
        /// <summary> 
        /// 计价是否相关_色彩 
        /// </summary> 
        public System.Boolean? a_bPrice_BasePrice_Color = null;
        /// <summary> 
        /// 计价是否相关_版位类别 
        /// </summary> 
        public System.Boolean? a_bPrice_BasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 计价是否相关_内容类别 
        /// </summary> 
        public System.Boolean? a_bPrice_BasePrice_ContentType = null;
        /// <summary> 
        /// 计价是否相关_星期 
        /// </summary> 
        public System.Boolean? a_bPrice_BasePrice_Week = null;
        /// <summary> 
        /// 格数(按格计价时默认格数) 
        /// </summary> 
        public System.Int32? a_iGridCount = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseMedia != null) { this.a_sGuidBaseMedia = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sType != null) { this.a_sType = ReplaceString.GetReplaceString(this.a_sType); }
            if (this.a_sPriceStandard != null) { this.a_sPriceStandard = ReplaceString.GetReplaceString(this.a_sPriceStandard); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BasePrice_Media_Specification( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "sGuidBaseMedia,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sType != null) { mySqlScript += "sType,"; }
            if (this.a_sPriceStandard != null) { mySqlScript += "sPriceStandard,"; }
            if (this.a_nWidth != null) { mySqlScript += "nWidth,"; }
            if (this.a_nHeight != null) { mySqlScript += "nHeight,"; }
            if (this.a_nArea != null) { mySqlScript += "nArea,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            if (this.a_bIsRaphe != null) { mySqlScript += "bIsRaphe,"; }
            if (this.a_bCanOnlyChange_Width != null) { mySqlScript += "bCanOnlyChange_Width,"; }
            if (this.a_bCanOnlyChange_Height != null) { mySqlScript += "bCanOnlyChange_Height,"; }
            if (this.a_bPrice_BasePrice_Color != null) { mySqlScript += "bPrice_BasePrice_Color,"; }
            if (this.a_bPrice_BasePrice_Media_PagePositionType != null) { mySqlScript += "bPrice_BasePrice_Media_PagePositionType,"; }
            if (this.a_bPrice_BasePrice_ContentType != null) { mySqlScript += "bPrice_BasePrice_ContentType,"; }
            if (this.a_bPrice_BasePrice_Week != null) { mySqlScript += "bPrice_BasePrice_Week,"; }
            if (this.a_iGridCount != null) { mySqlScript += "iGridCount,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "'" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sType != null) { mySqlScript += "'" + this.a_sType + "',"; }
            if (this.a_sPriceStandard != null) { mySqlScript += "'" + this.a_sPriceStandard + "',"; }
            if (this.a_nWidth != null) { mySqlScript += this.a_nWidth + ","; }
            if (this.a_nHeight != null) { mySqlScript += this.a_nHeight + ","; }
            if (this.a_nArea != null) { mySqlScript += this.a_nArea + ","; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            if (this.a_bIsRaphe != null) { mySqlScript += "'" + this.a_bIsRaphe + "',"; }
            if (this.a_bCanOnlyChange_Width != null) { mySqlScript += "'" + this.a_bCanOnlyChange_Width + "',"; }
            if (this.a_bCanOnlyChange_Height != null) { mySqlScript += "'" + this.a_bCanOnlyChange_Height + "',"; }
            if (this.a_bPrice_BasePrice_Color != null) { mySqlScript += "'" + this.a_bPrice_BasePrice_Color + "',"; }
            if (this.a_bPrice_BasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_bPrice_BasePrice_Media_PagePositionType + "',"; }
            if (this.a_bPrice_BasePrice_ContentType != null) { mySqlScript += "'" + this.a_bPrice_BasePrice_ContentType + "',"; }
            if (this.a_bPrice_BasePrice_Week != null) { mySqlScript += "'" + this.a_bPrice_BasePrice_Week + "',"; }
            if (this.a_iGridCount != null) { mySqlScript += this.a_iGridCount + ","; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BasePrice_Media_Specification set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidBaseMedia != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia = '" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sType != null) { iColumnCount++; mySqlScript += " sType = '" + this.a_sType + "',"; }
            if (this.a_sPriceStandard != null) { iColumnCount++; mySqlScript += " sPriceStandard = '" + this.a_sPriceStandard + "',"; }
            if (this.a_nWidth != null) { iColumnCount++; mySqlScript += " nWidth = " + this.a_nWidth + ","; }
            if (this.a_nHeight != null) { iColumnCount++; mySqlScript += " nHeight = " + this.a_nHeight + ","; }
            if (this.a_nArea != null) { iColumnCount++; mySqlScript += " nArea = " + this.a_nArea + ","; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            if (this.a_bIsRaphe != null) { iColumnCount++; mySqlScript += " bIsRaphe = '" + this.a_bIsRaphe + "',"; }
            if (this.a_bCanOnlyChange_Width != null) { iColumnCount++; mySqlScript += " bCanOnlyChange_Width = '" + this.a_bCanOnlyChange_Width + "',"; }
            if (this.a_bCanOnlyChange_Height != null) { iColumnCount++; mySqlScript += " bCanOnlyChange_Height = '" + this.a_bCanOnlyChange_Height + "',"; }
            if (this.a_bPrice_BasePrice_Color != null) { iColumnCount++; mySqlScript += " bPrice_BasePrice_Color = '" + this.a_bPrice_BasePrice_Color + "',"; }
            if (this.a_bPrice_BasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " bPrice_BasePrice_Media_PagePositionType = '" + this.a_bPrice_BasePrice_Media_PagePositionType + "',"; }
            if (this.a_bPrice_BasePrice_ContentType != null) { iColumnCount++; mySqlScript += " bPrice_BasePrice_ContentType = '" + this.a_bPrice_BasePrice_ContentType + "',"; }
            if (this.a_bPrice_BasePrice_Week != null) { iColumnCount++; mySqlScript += " bPrice_BasePrice_Week = '" + this.a_bPrice_BasePrice_Week + "',"; }
            if (this.a_iGridCount != null) { iColumnCount++; mySqlScript += " iGridCount = " + this.a_iGridCount + ","; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BasePrice_Media_Specification Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //星期定义( BasePrice_Week )  
    /// <summary>
    /// 星期定义
    /// </summary>
    public partial class Sql_BasePrice_Week
    {
        #region 与数据表(星期定义)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 设置值 
        /// </summary> 
        public System.String a_sValue = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sValue != null) { this.a_sValue = ReplaceString.GetReplaceString(this.a_sValue); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BasePrice_Week( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sValue != null) { mySqlScript += "sValue,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sValue != null) { mySqlScript += "'" + this.a_sValue + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BasePrice_Week set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sValue != null) { iColumnCount++; mySqlScript += " sValue = '" + this.a_sValue + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BasePrice_Week Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //欠款处罚参数( BasePunishment_Arrears )  
    /// <summary>
    /// 欠款处罚参数
    /// </summary>
    public partial class Sql_BasePunishment_Arrears
    {
        #region 与数据表(欠款处罚参数)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BasePunishment_Arrears( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BasePunishment_Arrears set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BasePunishment_Arrears Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //预开发票处罚参数( BasePunishment_PriorInvoice )  
    /// <summary>
    /// 预开发票处罚参数
    /// </summary>
    public partial class Sql_BasePunishment_PriorInvoice
    {
        #region 与数据表(预开发票处罚参数)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BasePunishment_PriorInvoice( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BasePunishment_PriorInvoice set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BasePunishment_PriorInvoice Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //角色(菜单/查询范围/修改范围)( BaseRole )  
    /// <summary>
    /// 角色(菜单/查询范围/修改范围)
    /// </summary>
    public partial class Sql_BaseRole
    {
        #region 与数据表(角色(菜单/查询范围/修改范围))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 类型(菜单范围/查询范围/修改范围) 
        /// </summary> 
        public System.String a_sType = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 内容(选中的权限) 
        /// </summary> 
        public System.String a_sContent = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sType != null) { this.a_sType = ReplaceString.GetReplaceString(this.a_sType); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sContent != null) { this.a_sContent = ReplaceString.GetReplaceString(this.a_sContent); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseRole( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sType != null) { mySqlScript += "sType,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sContent != null) { mySqlScript += "sContent,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { mySqlScript += "'" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sContent != null) { mySqlScript += "'" + this.a_sContent + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseRole set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { iColumnCount++; mySqlScript += " sType = '" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sContent != null) { iColumnCount++; mySqlScript += " sContent = '" + this.a_sContent + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseRole Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //销售活动分类( BaseSales_Activity_Categories )  
    /// <summary>
    /// 销售活动分类
    /// </summary>
    public partial class Sql_BaseSales_Activity_Categories
    {
        #region 与数据表(销售活动分类)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseSales_Activity_Categories( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseSales_Activity_Categories set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseSales_Activity_Categories Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //销售活动状态( BaseSales_Activity_Status )  
    /// <summary>
    /// 销售活动状态
    /// </summary>
    public partial class Sql_BaseSales_Activity_Status
    {
        #region 与数据表(销售活动状态)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseSales_Activity_Status( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseSales_Activity_Status set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseSales_Activity_Status Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //活动跟踪分类( BaseSales_ActivityTrace_Categories )  
    /// <summary>
    /// 活动跟踪分类
    /// </summary>
    public partial class Sql_BaseSales_ActivityTrace_Categories
    {
        #region 与数据表(活动跟踪分类)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseSales_ActivityTrace_Categories( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseSales_ActivityTrace_Categories set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseSales_ActivityTrace_Categories Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //销售活动资料分类( BaseSales_Material_Categories )  
    /// <summary>
    /// 销售活动资料分类
    /// </summary>
    public partial class Sql_BaseSales_Material_Categories
    {
        #region 与数据表(销售活动资料分类)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseSales_Material_Categories( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseSales_Material_Categories set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseSales_Material_Categories Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //销售活动资料库( BaseSales_Material_Library )  
    /// <summary>
    /// 销售活动资料库
    /// </summary>
    public partial class Sql_BaseSales_Material_Library
    {
        #region 与数据表(销售活动资料库)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseSales_Material_Library( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseSales_Material_Library set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseSales_Material_Library Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //工作报告分类( BaseSales_WorkReport_Categories )  
    /// <summary>
    /// 工作报告分类
    /// </summary>
    public partial class Sql_BaseSales_WorkReport_Categories
    {
        #region 与数据表(工作报告分类)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  BaseSales_WorkReport_Categories( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  BaseSales_WorkReport_Categories set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  BaseSales_WorkReport_Categories Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //审批类型( InfoApproval )  
    /// <summary>
    /// 审批类型
    /// </summary>
    public partial class Sql_InfoApproval
    {
        #region 与数据表(审批类型)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 功能链接 
        /// </summary> 
        public System.String a_sFeaturesURL = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sFeaturesURL != null) { this.a_sFeaturesURL = ReplaceString.GetReplaceString(this.a_sFeaturesURL); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  InfoApproval( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sFeaturesURL != null) { mySqlScript += "sFeaturesURL,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sFeaturesURL != null) { mySqlScript += "'" + this.a_sFeaturesURL + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  InfoApproval set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sFeaturesURL != null) { iColumnCount++; mySqlScript += " sFeaturesURL = '" + this.a_sFeaturesURL + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  InfoApproval Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //收款方式( InfoBaseFinance_ReceiveMoneyMode )  
    /// <summary>
    /// 收款方式
    /// </summary>
    public partial class Sql_InfoBaseFinance_ReceiveMoneyMode
    {
        #region 与数据表(收款方式)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 业务员任务比例 
        /// </summary> 
        public System.Double? a_nPercentage_Employee_Task = null;
        /// <summary> 
        /// 业务员佣金比例 
        /// </summary> 
        public System.Double? a_nPercentage_Employee_Commission = null;
        /// <summary> 
        /// 公关人任务比例 
        /// </summary> 
        public System.Double? a_nPercentage_PublicRelations_Task = null;
        /// <summary> 
        /// 公关人佣金比例 
        /// </summary> 
        public System.Double? a_nPercentage_PublicRelations_Commission = null;
        /// <summary> 
        /// 正常收款 
        /// </summary> 
        public System.Boolean? a_bNormal = null;
        /// <summary> 
        /// 客户返回金 
        /// </summary> 
        public System.Boolean? a_bCustomerReturnMoney = null;
        /// <summary> 
        /// 实物抵账 
        /// </summary> 
        public System.Boolean? a_bCommodityReplaceArrears = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  InfoBaseFinance_ReceiveMoneyMode( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_nPercentage_Employee_Task != null) { mySqlScript += "nPercentage_Employee_Task,"; }
            if (this.a_nPercentage_Employee_Commission != null) { mySqlScript += "nPercentage_Employee_Commission,"; }
            if (this.a_nPercentage_PublicRelations_Task != null) { mySqlScript += "nPercentage_PublicRelations_Task,"; }
            if (this.a_nPercentage_PublicRelations_Commission != null) { mySqlScript += "nPercentage_PublicRelations_Commission,"; }
            if (this.a_bNormal != null) { mySqlScript += "bNormal,"; }
            if (this.a_bCustomerReturnMoney != null) { mySqlScript += "bCustomerReturnMoney,"; }
            if (this.a_bCommodityReplaceArrears != null) { mySqlScript += "bCommodityReplaceArrears,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_nPercentage_Employee_Task != null) { mySqlScript += this.a_nPercentage_Employee_Task + ","; }
            if (this.a_nPercentage_Employee_Commission != null) { mySqlScript += this.a_nPercentage_Employee_Commission + ","; }
            if (this.a_nPercentage_PublicRelations_Task != null) { mySqlScript += this.a_nPercentage_PublicRelations_Task + ","; }
            if (this.a_nPercentage_PublicRelations_Commission != null) { mySqlScript += this.a_nPercentage_PublicRelations_Commission + ","; }
            if (this.a_bNormal != null) { mySqlScript += "'" + this.a_bNormal + "',"; }
            if (this.a_bCustomerReturnMoney != null) { mySqlScript += "'" + this.a_bCustomerReturnMoney + "',"; }
            if (this.a_bCommodityReplaceArrears != null) { mySqlScript += "'" + this.a_bCommodityReplaceArrears + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  InfoBaseFinance_ReceiveMoneyMode set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_nPercentage_Employee_Task != null) { iColumnCount++; mySqlScript += " nPercentage_Employee_Task = " + this.a_nPercentage_Employee_Task + ","; }
            if (this.a_nPercentage_Employee_Commission != null) { iColumnCount++; mySqlScript += " nPercentage_Employee_Commission = " + this.a_nPercentage_Employee_Commission + ","; }
            if (this.a_nPercentage_PublicRelations_Task != null) { iColumnCount++; mySqlScript += " nPercentage_PublicRelations_Task = " + this.a_nPercentage_PublicRelations_Task + ","; }
            if (this.a_nPercentage_PublicRelations_Commission != null) { iColumnCount++; mySqlScript += " nPercentage_PublicRelations_Commission = " + this.a_nPercentage_PublicRelations_Commission + ","; }
            if (this.a_bNormal != null) { iColumnCount++; mySqlScript += " bNormal = '" + this.a_bNormal + "',"; }
            if (this.a_bCustomerReturnMoney != null) { iColumnCount++; mySqlScript += " bCustomerReturnMoney = '" + this.a_bCustomerReturnMoney + "',"; }
            if (this.a_bCommodityReplaceArrears != null) { iColumnCount++; mySqlScript += " bCommodityReplaceArrears = '" + this.a_bCommodityReplaceArrears + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  InfoBaseFinance_ReceiveMoneyMode Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //基础信息版本号( InfoBaseVersion )  
    /// <summary>
    /// 基础信息版本号
    /// </summary>
    public partial class Sql_InfoBaseVersion
    {
        #region 与数据表(基础信息版本号)对应的字段属性
        /// <summary> 
        /// 表名 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 版本号 
        /// </summary> 
        public System.String a_sVersion = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sVersion != null) { this.a_sVersion = ReplaceString.GetReplaceString(this.a_sVersion); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  InfoBaseVersion( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sVersion != null) { mySqlScript += "sVersion,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sVersion != null) { mySqlScript += "'" + this.a_sVersion + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  InfoBaseVersion set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sVersion != null) { iColumnCount++; mySqlScript += " sVersion = '" + this.a_sVersion + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  InfoBaseVersion Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //菜单( InfoMenu )  
    /// <summary>
    /// 菜单
    /// </summary>
    public partial class Sql_InfoMenu
    {
        #region 与数据表(菜单)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// ID 
        /// </summary> 
        public System.String a_sID = null;
        /// <summary> 
        /// 说明 
        /// </summary> 
        public System.String a_sCaption = null;
        /// <summary> 
        /// 父级ID 
        /// </summary> 
        public System.String a_sParentID = null;
        /// <summary> 
        /// 层次 
        /// </summary> 
        public System.Int32? a_iDepth = null;
        /// <summary> 
        /// 图标路径 
        /// </summary> 
        public System.String a_sIconPath = null;
        /// <summary> 
        /// 功能URL 
        /// </summary> 
        public System.String a_sFeaturesURL = null;
        /// <summary> 
        /// 是扩展功能 
        /// </summary> 
        public System.Boolean? a_bExtend = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sID != null) { this.a_sID = ReplaceString.GetReplaceString(this.a_sID); }
            if (this.a_sCaption != null) { this.a_sCaption = ReplaceString.GetReplaceString(this.a_sCaption); }
            if (this.a_sParentID != null) { this.a_sParentID = ReplaceString.GetReplaceString(this.a_sParentID); }
            if (this.a_sIconPath != null) { this.a_sIconPath = ReplaceString.GetReplaceString(this.a_sIconPath); }
            if (this.a_sFeaturesURL != null) { this.a_sFeaturesURL = ReplaceString.GetReplaceString(this.a_sFeaturesURL); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  InfoMenu( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sID != null) { mySqlScript += "sID,"; }
            if (this.a_sCaption != null) { mySqlScript += "sCaption,"; }
            if (this.a_sParentID != null) { mySqlScript += "sParentID,"; }
            if (this.a_iDepth != null) { mySqlScript += "iDepth,"; }
            if (this.a_sIconPath != null) { mySqlScript += "sIconPath,"; }
            if (this.a_sFeaturesURL != null) { mySqlScript += "sFeaturesURL,"; }
            if (this.a_bExtend != null) { mySqlScript += "bExtend,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sID != null) { mySqlScript += "'" + this.a_sID + "',"; }
            if (this.a_sCaption != null) { mySqlScript += "'" + this.a_sCaption + "',"; }
            if (this.a_sParentID != null) { mySqlScript += "'" + this.a_sParentID + "',"; }
            if (this.a_iDepth != null) { mySqlScript += this.a_iDepth + ","; }
            if (this.a_sIconPath != null) { mySqlScript += "'" + this.a_sIconPath + "',"; }
            if (this.a_sFeaturesURL != null) { mySqlScript += "'" + this.a_sFeaturesURL + "',"; }
            if (this.a_bExtend != null) { mySqlScript += "'" + this.a_bExtend + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  InfoMenu set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sID != null) { iColumnCount++; mySqlScript += " sID = '" + this.a_sID + "',"; }
            if (this.a_sCaption != null) { iColumnCount++; mySqlScript += " sCaption = '" + this.a_sCaption + "',"; }
            if (this.a_sParentID != null) { iColumnCount++; mySqlScript += " sParentID = '" + this.a_sParentID + "',"; }
            if (this.a_iDepth != null) { iColumnCount++; mySqlScript += " iDepth = " + this.a_iDepth + ","; }
            if (this.a_sIconPath != null) { iColumnCount++; mySqlScript += " sIconPath = '" + this.a_sIconPath + "',"; }
            if (this.a_sFeaturesURL != null) { iColumnCount++; mySqlScript += " sFeaturesURL = '" + this.a_sFeaturesURL + "',"; }
            if (this.a_bExtend != null) { iColumnCount++; mySqlScript += " bExtend = '" + this.a_bExtend + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  InfoMenu Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //菜单(参数定义)( InfoMenu_CSDY )  
    /// <summary>
    /// 菜单(参数定义)
    /// </summary>
    public partial class Sql_InfoMenu_CSDY
    {
        #region 与数据表(菜单(参数定义))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  InfoMenu_CSDY( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  InfoMenu_CSDY set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  InfoMenu_CSDY Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //系统参数( InfoParameter )  
    /// <summary>
    /// 系统参数
    /// </summary>
    public partial class Sql_InfoParameter
    {
        #region 与数据表(系统参数)对应的字段属性
        /// <summary> 
        /// 类型 
        /// </summary> 
        public System.String a_sType = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 参数 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 主键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// ID 
        /// </summary> 
        public System.String a_ID = null;
        /// <summary> 
        /// 数值 
        /// </summary> 
        public System.String a_sValue = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sType != null) { this.a_sType = ReplaceString.GetReplaceString(this.a_sType); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_ID != null) { this.a_ID = ReplaceString.GetReplaceString(this.a_ID); }
            if (this.a_sValue != null) { this.a_sValue = ReplaceString.GetReplaceString(this.a_sValue); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  InfoParameter( ";
            if (this.a_sType != null) { mySqlScript += "sType,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_ID != null) { mySqlScript += "ID,"; }
            if (this.a_sValue != null) { mySqlScript += "sValue,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sType != null) { mySqlScript += "'" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_ID != null) { mySqlScript += "'" + this.a_ID + "',"; }
            if (this.a_sValue != null) { mySqlScript += "'" + this.a_sValue + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  InfoParameter set  ";
            if (this.a_sType != null) { iColumnCount++; mySqlScript += " sType = '" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_ID != null) { iColumnCount++; mySqlScript += " ID = '" + this.a_ID + "',"; }
            if (this.a_sValue != null) { iColumnCount++; mySqlScript += " sValue = '" + this.a_sValue + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  InfoParameter Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //收费类型(直接收款/预收款)( InfoReceivedMoneyType )  
    /// <summary>
    /// 收费类型(直接收款/预收款)
    /// </summary>
    public partial class Sql_InfoReceivedMoneyType
    {
        #region 与数据表(收费类型(直接收款/预收款))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  InfoReceivedMoneyType( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  InfoReceivedMoneyType set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  InfoReceivedMoneyType Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //收款项目( InfoReceiveMoneyItem )  
    /// <summary>
    /// 收款项目
    /// </summary>
    public partial class Sql_InfoReceiveMoneyItem
    {
        #region 与数据表(收款项目)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  InfoReceiveMoneyItem( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  InfoReceiveMoneyItem set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  InfoReceiveMoneyItem Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //客户服务类型( InfoSalesServiceType )  
    /// <summary>
    /// 客户服务类型
    /// </summary>
    public partial class Sql_InfoSalesServiceType
    {
        #region 与数据表(客户服务类型)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 服务类型 
        /// </summary> 
        public System.String a_sName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  InfoSalesServiceType( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  InfoSalesServiceType set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  InfoSalesServiceType Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //工作报告类型( InfoWorkReportCycleType )  
    /// <summary>
    /// 工作报告类型
    /// </summary>
    public partial class Sql_InfoWorkReportCycleType
    {
        #region 与数据表(工作报告类型)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  InfoWorkReportCycleType( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  InfoWorkReportCycleType set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  InfoWorkReportCycleType Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //部门结构结存( Work_Balance_Department )  
    /// <summary>
    /// 部门结构结存
    /// </summary>
    public partial class Sql_Work_Balance_Department
    {
        #region 与数据表(部门结构结存)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Work_Balance_Department( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Work_Balance_Department set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Work_Balance_Department Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //部门结构结存明细( Work_Balance_Department_Details )  
    /// <summary>
    /// 部门结构结存明细
    /// </summary>
    public partial class Sql_Work_Balance_Department_Details
    {
        #region 与数据表(部门结构结存明细)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Work_Balance_Department_Details( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Work_Balance_Department_Details set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Work_Balance_Department_Details Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //业务员任务( Work_Department_Person_EmployeeTask )  
    /// <summary>
    /// 业务员任务
    /// </summary>
    public partial class Sql_Work_Department_Person_EmployeeTask
    {
        #region 与数据表(业务员任务)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 名称 
        /// </summary> 
        public System.String a_sName = null;
        /// <summary> 
        /// 默认 
        /// </summary> 
        public System.Boolean? a_bDefault = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sName != null) { this.a_sName = ReplaceString.GetReplaceString(this.a_sName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Work_Department_Person_EmployeeTask( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sName != null) { mySqlScript += "sName,"; }
            if (this.a_bDefault != null) { mySqlScript += "bDefault,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sName != null) { mySqlScript += "'" + this.a_sName + "',"; }
            if (this.a_bDefault != null) { mySqlScript += "'" + this.a_bDefault + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Work_Department_Person_EmployeeTask set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sName != null) { iColumnCount++; mySqlScript += " sName = '" + this.a_sName + "',"; }
            if (this.a_bDefault != null) { iColumnCount++; mySqlScript += " bDefault = '" + this.a_bDefault + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Work_Department_Person_EmployeeTask Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //业务员任务明细( Work_Department_Person_EmployeeTask_Details )  
    /// <summary>
    /// 业务员任务明细
    /// </summary>
    public partial class Sql_Work_Department_Person_EmployeeTask_Details
    {
        #region 与数据表(业务员任务明细)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 任务ID 
        /// </summary> 
        public System.String a_sGuidWork_Department_Person_EmployeeTask = null;
        /// <summary> 
        /// 部门1级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_1 = null;
        /// <summary> 
        /// 部门1级 
        /// </summary> 
        public System.String a_sNameBase_Department_1 = null;
        /// <summary> 
        /// 部门2级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_2 = null;
        /// <summary> 
        /// 部门2级 
        /// </summary> 
        public System.String a_sNameBase_Department_2 = null;
        /// <summary> 
        /// 部门3级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_3 = null;
        /// <summary> 
        /// 部门3级 
        /// </summary> 
        public System.String a_sNameBase_Department_3 = null;
        /// <summary> 
        /// 业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 业务员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person = null;
        /// <summary> 
        /// 任务额 
        /// </summary> 
        public System.Double? a_nTask = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWork_Department_Person_EmployeeTask != null) { this.a_sGuidWork_Department_Person_EmployeeTask = ReplaceString.GetReplaceString(this.a_sGuidWork_Department_Person_EmployeeTask); }
            if (this.a_sGuidBase_Department_1 != null) { this.a_sGuidBase_Department_1 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_1); }
            if (this.a_sNameBase_Department_1 != null) { this.a_sNameBase_Department_1 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_1); }
            if (this.a_sGuidBase_Department_2 != null) { this.a_sGuidBase_Department_2 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_2); }
            if (this.a_sNameBase_Department_2 != null) { this.a_sNameBase_Department_2 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_2); }
            if (this.a_sGuidBase_Department_3 != null) { this.a_sGuidBase_Department_3 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_3); }
            if (this.a_sNameBase_Department_3 != null) { this.a_sNameBase_Department_3 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_3); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sNameBase_Department_Person != null) { this.a_sNameBase_Department_Person = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Work_Department_Person_EmployeeTask_Details( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWork_Department_Person_EmployeeTask != null) { mySqlScript += "sGuidWork_Department_Person_EmployeeTask,"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "sGuidBase_Department_1,"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "sNameBase_Department_1,"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "sGuidBase_Department_2,"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "sNameBase_Department_2,"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "sGuidBase_Department_3,"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "sNameBase_Department_3,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "sNameBase_Department_Person,"; }
            if (this.a_nTask != null) { mySqlScript += "nTask,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWork_Department_Person_EmployeeTask != null) { mySqlScript += "'" + this.a_sGuidWork_Department_Person_EmployeeTask + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "'" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "'" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "'" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_nTask != null) { mySqlScript += this.a_nTask + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Work_Department_Person_EmployeeTask_Details set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWork_Department_Person_EmployeeTask != null) { iColumnCount++; mySqlScript += " sGuidWork_Department_Person_EmployeeTask = '" + this.a_sGuidWork_Department_Person_EmployeeTask + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_1 = '" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_1 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_1 = '" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_2 = '" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_2 = '" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_3 = '" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_3 = '" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person = '" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_nTask != null) { iColumnCount++; mySqlScript += " nTask = " + this.a_nTask + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Work_Department_Person_EmployeeTask_Details Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //广告上版与撤版历史( Work_HB_AdvertisingHistoryForPage )  
    /// <summary>
    /// 广告上版与撤版历史
    /// </summary>
    public partial class Sql_Work_HB_AdvertisingHistoryForPage
    {
        #region 与数据表(广告上版与撤版历史)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Work_HB_AdvertisingHistoryForPage( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Work_HB_AdvertisingHistoryForPage set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Work_HB_AdvertisingHistoryForPage Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //版面划版时间( Work_HB_Page_Date )  
    /// <summary>
    /// 版面划版时间
    /// </summary>
    public partial class Sql_Work_HB_Page_Date
    {
        #region 与数据表(版面划版时间)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Work_HB_Page_Date( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Work_HB_Page_Date set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Work_HB_Page_Date Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //划版提示(当广告刊期修改的时候)现在不用了( Work_HB_PositionMessage )  
    /// <summary>
    /// 划版提示(当广告刊期修改的时候)现在不用了
    /// </summary>
    public partial class Sql_Work_HB_PositionMessage
    {
        #region 与数据表(划版提示(当广告刊期修改的时候)现在不用了)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Work_HB_PositionMessage( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Work_HB_PositionMessage set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Work_HB_PositionMessage Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //划版跨版设置( Work_HB_StridePage )  
    /// <summary>
    /// 划版跨版设置
    /// </summary>
    public partial class Sql_Work_HB_StridePage
    {
        #region 与数据表(划版跨版设置)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  Work_HB_StridePage( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  Work_HB_StridePage set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  Work_HB_StridePage Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //改判归属申请( WorkApplication_ChangeEmployee )  
    /// <summary>
    /// 改判归属申请
    /// </summary>
    public partial class Sql_WorkApplication_ChangeEmployee
    {
        #region 与数据表(改判归属申请)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 审批流程ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 申请状态 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 原业务员信息 
        /// </summary> 
        public System.String a_sEmployeeInfo_Old = null;
        /// <summary> 
        /// 新业务员信息 
        /// </summary> 
        public System.String a_sEmployeeInfo_New = null;
        /// <summary> 
        /// 审批人 
        /// </summary> 
        public System.String a_sApprovalMan = null;
        /// <summary> 
        /// 审批时间 
        /// </summary> 
        public System.DateTime? a_dApprovalDate = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sEmployeeInfo_Old != null) { this.a_sEmployeeInfo_Old = ReplaceString.GetReplaceString(this.a_sEmployeeInfo_Old); }
            if (this.a_sEmployeeInfo_New != null) { this.a_sEmployeeInfo_New = ReplaceString.GetReplaceString(this.a_sEmployeeInfo_New); }
            if (this.a_sApprovalMan != null) { this.a_sApprovalMan = ReplaceString.GetReplaceString(this.a_sApprovalMan); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_ChangeEmployee( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sEmployeeInfo_Old != null) { mySqlScript += "sEmployeeInfo_Old,"; }
            if (this.a_sEmployeeInfo_New != null) { mySqlScript += "sEmployeeInfo_New,"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "sApprovalMan,"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "dApprovalDate,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sEmployeeInfo_Old != null) { mySqlScript += "'" + this.a_sEmployeeInfo_Old + "',"; }
            if (this.a_sEmployeeInfo_New != null) { mySqlScript += "'" + this.a_sEmployeeInfo_New + "',"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "'" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "'" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_ChangeEmployee set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sEmployeeInfo_Old != null) { iColumnCount++; mySqlScript += " sEmployeeInfo_Old = '" + this.a_sEmployeeInfo_Old + "',"; }
            if (this.a_sEmployeeInfo_New != null) { iColumnCount++; mySqlScript += " sEmployeeInfo_New = '" + this.a_sEmployeeInfo_New + "',"; }
            if (this.a_sApprovalMan != null) { iColumnCount++; mySqlScript += " sApprovalMan = '" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { iColumnCount++; mySqlScript += " dApprovalDate = '" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_ChangeEmployee Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //改判归属申请明细( WorkApplication_ChangeEmployee_Details )  
    /// <summary>
    /// 改判归属申请明细
    /// </summary>
    public partial class Sql_WorkApplication_ChangeEmployee_Details
    {
        #region 与数据表(改判归属申请明细)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 申请ID 
        /// </summary> 
        public System.String a_sGuidWorkApplication_ChangeEmployee = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 原部门名称 
        /// </summary> 
        public System.String a_sDepartmentName_Old = null;
        /// <summary> 
        /// 原业务员ID 
        /// </summary> 
        public System.String a_sGuid_Base_Department_Person_OldEmployee = null;
        /// <summary> 
        /// 原业务员 
        /// </summary> 
        public System.String a_sName_Base_Department_Person_OldEmployee = null;
        /// <summary> 
        /// 新业务员ID 
        /// </summary> 
        public System.String a_sGuid_Base_Department_Person_NewEmployee = null;
        /// <summary> 
        /// 新业务员 
        /// </summary> 
        public System.String a_sName_Base_Department_Person_NewEmployee = null;
        /// <summary> 
        /// 原分配比例 
        /// </summary> 
        public System.Double? a_nPercentage_Old = null;
        /// <summary> 
        /// 新分配比例 
        /// </summary> 
        public System.Double? a_nPercentage_New = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkApplication_ChangeEmployee != null) { this.a_sGuidWorkApplication_ChangeEmployee = ReplaceString.GetReplaceString(this.a_sGuidWorkApplication_ChangeEmployee); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sDepartmentName_Old != null) { this.a_sDepartmentName_Old = ReplaceString.GetReplaceString(this.a_sDepartmentName_Old); }
            if (this.a_sGuid_Base_Department_Person_OldEmployee != null) { this.a_sGuid_Base_Department_Person_OldEmployee = ReplaceString.GetReplaceString(this.a_sGuid_Base_Department_Person_OldEmployee); }
            if (this.a_sName_Base_Department_Person_OldEmployee != null) { this.a_sName_Base_Department_Person_OldEmployee = ReplaceString.GetReplaceString(this.a_sName_Base_Department_Person_OldEmployee); }
            if (this.a_sGuid_Base_Department_Person_NewEmployee != null) { this.a_sGuid_Base_Department_Person_NewEmployee = ReplaceString.GetReplaceString(this.a_sGuid_Base_Department_Person_NewEmployee); }
            if (this.a_sName_Base_Department_Person_NewEmployee != null) { this.a_sName_Base_Department_Person_NewEmployee = ReplaceString.GetReplaceString(this.a_sName_Base_Department_Person_NewEmployee); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_ChangeEmployee_Details( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkApplication_ChangeEmployee != null) { mySqlScript += "sGuidWorkApplication_ChangeEmployee,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_sDepartmentName_Old != null) { mySqlScript += "sDepartmentName_Old,"; }
            if (this.a_sGuid_Base_Department_Person_OldEmployee != null) { mySqlScript += "sGuid_Base_Department_Person_OldEmployee,"; }
            if (this.a_sName_Base_Department_Person_OldEmployee != null) { mySqlScript += "sName_Base_Department_Person_OldEmployee,"; }
            if (this.a_sGuid_Base_Department_Person_NewEmployee != null) { mySqlScript += "sGuid_Base_Department_Person_NewEmployee,"; }
            if (this.a_sName_Base_Department_Person_NewEmployee != null) { mySqlScript += "sName_Base_Department_Person_NewEmployee,"; }
            if (this.a_nPercentage_Old != null) { mySqlScript += "nPercentage_Old,"; }
            if (this.a_nPercentage_New != null) { mySqlScript += "nPercentage_New,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkApplication_ChangeEmployee != null) { mySqlScript += "'" + this.a_sGuidWorkApplication_ChangeEmployee + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sDepartmentName_Old != null) { mySqlScript += "'" + this.a_sDepartmentName_Old + "',"; }
            if (this.a_sGuid_Base_Department_Person_OldEmployee != null) { mySqlScript += "'" + this.a_sGuid_Base_Department_Person_OldEmployee + "',"; }
            if (this.a_sName_Base_Department_Person_OldEmployee != null) { mySqlScript += "'" + this.a_sName_Base_Department_Person_OldEmployee + "',"; }
            if (this.a_sGuid_Base_Department_Person_NewEmployee != null) { mySqlScript += "'" + this.a_sGuid_Base_Department_Person_NewEmployee + "',"; }
            if (this.a_sName_Base_Department_Person_NewEmployee != null) { mySqlScript += "'" + this.a_sName_Base_Department_Person_NewEmployee + "',"; }
            if (this.a_nPercentage_Old != null) { mySqlScript += this.a_nPercentage_Old + ","; }
            if (this.a_nPercentage_New != null) { mySqlScript += this.a_nPercentage_New + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_ChangeEmployee_Details set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkApplication_ChangeEmployee != null) { iColumnCount++; mySqlScript += " sGuidWorkApplication_ChangeEmployee = '" + this.a_sGuidWorkApplication_ChangeEmployee + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sDepartmentName_Old != null) { iColumnCount++; mySqlScript += " sDepartmentName_Old = '" + this.a_sDepartmentName_Old + "',"; }
            if (this.a_sGuid_Base_Department_Person_OldEmployee != null) { iColumnCount++; mySqlScript += " sGuid_Base_Department_Person_OldEmployee = '" + this.a_sGuid_Base_Department_Person_OldEmployee + "',"; }
            if (this.a_sName_Base_Department_Person_OldEmployee != null) { iColumnCount++; mySqlScript += " sName_Base_Department_Person_OldEmployee = '" + this.a_sName_Base_Department_Person_OldEmployee + "',"; }
            if (this.a_sGuid_Base_Department_Person_NewEmployee != null) { iColumnCount++; mySqlScript += " sGuid_Base_Department_Person_NewEmployee = '" + this.a_sGuid_Base_Department_Person_NewEmployee + "',"; }
            if (this.a_sName_Base_Department_Person_NewEmployee != null) { iColumnCount++; mySqlScript += " sName_Base_Department_Person_NewEmployee = '" + this.a_sName_Base_Department_Person_NewEmployee + "',"; }
            if (this.a_nPercentage_Old != null) { iColumnCount++; mySqlScript += " nPercentage_Old = " + this.a_nPercentage_Old + ","; }
            if (this.a_nPercentage_New != null) { iColumnCount++; mySqlScript += " nPercentage_New = " + this.a_nPercentage_New + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_ChangeEmployee_Details Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //改刊申请( WorkApplication_ChangeIssue )  
    /// <summary>
    /// 改刊申请
    /// </summary>
    public partial class Sql_WorkApplication_ChangeIssue
    {
        #region 与数据表(改刊申请)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 审批流程ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 审批状态 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 审批人 
        /// </summary> 
        public System.String a_sApprovalMan = null;
        /// <summary> 
        /// 审批时间 
        /// </summary> 
        public System.DateTime? a_dApprovalDate = null;
        /// <summary> 
        /// 申请内容 
        /// </summary> 
        public System.String a_sContent = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sApprovalMan != null) { this.a_sApprovalMan = ReplaceString.GetReplaceString(this.a_sApprovalMan); }
            if (this.a_sContent != null) { this.a_sContent = ReplaceString.GetReplaceString(this.a_sContent); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_ChangeIssue( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "sApprovalMan,"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "dApprovalDate,"; }
            if (this.a_sContent != null) { mySqlScript += "sContent,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "'" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "'" + this.a_dApprovalDate + "',"; }
            if (this.a_sContent != null) { mySqlScript += "'" + this.a_sContent + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_ChangeIssue set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { iColumnCount++; mySqlScript += " sApprovalMan = '" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { iColumnCount++; mySqlScript += " dApprovalDate = '" + this.a_dApprovalDate + "',"; }
            if (this.a_sContent != null) { iColumnCount++; mySqlScript += " sContent = '" + this.a_sContent + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_ChangeIssue Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //改刊申请明细( WorkApplication_ChangeIssue_Details )  
    /// <summary>
    /// 改刊申请明细
    /// </summary>
    public partial class Sql_WorkApplication_ChangeIssue_Details
    {
        #region 与数据表(改刊申请明细)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 申请ID 
        /// </summary> 
        public System.String a_sGuidWorkApplication_ChangeIssue = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 原叠次 
        /// </summary> 
        public System.String a_s_Name_Flod_Old = null;
        /// <summary> 
        /// 新叠次 
        /// </summary> 
        public System.String a_s_Name_Flod_New = null;
        /// <summary> 
        /// 原版面 
        /// </summary> 
        public System.String a_s_Name_Page_Old = null;
        /// <summary> 
        /// 新版面 
        /// </summary> 
        public System.String a_s_Name_Page_New = null;
        /// <summary> 
        /// 原色彩ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Color_Old = null;
        /// <summary> 
        /// 原色彩 
        /// </summary> 
        public System.String a_sNameBasePrice_Color_Old = null;
        /// <summary> 
        /// 新色彩ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Color_New = null;
        /// <summary> 
        /// 新色彩 
        /// </summary> 
        public System.String a_sNameBasePrice_Color_New = null;
        /// <summary> 
        /// 原规格ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_Specification_Old = null;
        /// <summary> 
        /// 原规格 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_Specification_Old = null;
        /// <summary> 
        /// 新规格ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_Specification_New = null;
        /// <summary> 
        /// 新规格 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_Specification_New = null;
        /// <summary> 
        /// 原版位类型ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_PagePositionType_Old = null;
        /// <summary> 
        /// 原版位类型 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_PagePositionType_Old = null;
        /// <summary> 
        /// 新版位类型ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_PagePositionType_New = null;
        /// <summary> 
        /// 新版位类型 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_PagePositionType_New = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkApplication_ChangeIssue != null) { this.a_sGuidWorkApplication_ChangeIssue = ReplaceString.GetReplaceString(this.a_sGuidWorkApplication_ChangeIssue); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_s_Name_Flod_Old != null) { this.a_s_Name_Flod_Old = ReplaceString.GetReplaceString(this.a_s_Name_Flod_Old); }
            if (this.a_s_Name_Flod_New != null) { this.a_s_Name_Flod_New = ReplaceString.GetReplaceString(this.a_s_Name_Flod_New); }
            if (this.a_s_Name_Page_Old != null) { this.a_s_Name_Page_Old = ReplaceString.GetReplaceString(this.a_s_Name_Page_Old); }
            if (this.a_s_Name_Page_New != null) { this.a_s_Name_Page_New = ReplaceString.GetReplaceString(this.a_s_Name_Page_New); }
            if (this.a_sGuidBasePrice_Color_Old != null) { this.a_sGuidBasePrice_Color_Old = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Color_Old); }
            if (this.a_sNameBasePrice_Color_Old != null) { this.a_sNameBasePrice_Color_Old = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Color_Old); }
            if (this.a_sGuidBasePrice_Color_New != null) { this.a_sGuidBasePrice_Color_New = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Color_New); }
            if (this.a_sNameBasePrice_Color_New != null) { this.a_sNameBasePrice_Color_New = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Color_New); }
            if (this.a_sGuidBasePrice_Media_Specification_Old != null) { this.a_sGuidBasePrice_Media_Specification_Old = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_Specification_Old); }
            if (this.a_sNameBasePrice_Media_Specification_Old != null) { this.a_sNameBasePrice_Media_Specification_Old = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_Specification_Old); }
            if (this.a_sGuidBasePrice_Media_Specification_New != null) { this.a_sGuidBasePrice_Media_Specification_New = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_Specification_New); }
            if (this.a_sNameBasePrice_Media_Specification_New != null) { this.a_sNameBasePrice_Media_Specification_New = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_Specification_New); }
            if (this.a_sGuidBasePrice_Media_PagePositionType_Old != null) { this.a_sGuidBasePrice_Media_PagePositionType_Old = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_PagePositionType_Old); }
            if (this.a_sNameBasePrice_Media_PagePositionType_Old != null) { this.a_sNameBasePrice_Media_PagePositionType_Old = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_PagePositionType_Old); }
            if (this.a_sGuidBasePrice_Media_PagePositionType_New != null) { this.a_sGuidBasePrice_Media_PagePositionType_New = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_PagePositionType_New); }
            if (this.a_sNameBasePrice_Media_PagePositionType_New != null) { this.a_sNameBasePrice_Media_PagePositionType_New = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_PagePositionType_New); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_ChangeIssue_Details( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkApplication_ChangeIssue != null) { mySqlScript += "sGuidWorkApplication_ChangeIssue,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_s_Name_Flod_Old != null) { mySqlScript += "s_Name_Flod_Old,"; }
            if (this.a_s_Name_Flod_New != null) { mySqlScript += "s_Name_Flod_New,"; }
            if (this.a_s_Name_Page_Old != null) { mySqlScript += "s_Name_Page_Old,"; }
            if (this.a_s_Name_Page_New != null) { mySqlScript += "s_Name_Page_New,"; }
            if (this.a_sGuidBasePrice_Color_Old != null) { mySqlScript += "sGuidBasePrice_Color_Old,"; }
            if (this.a_sNameBasePrice_Color_Old != null) { mySqlScript += "sNameBasePrice_Color_Old,"; }
            if (this.a_sGuidBasePrice_Color_New != null) { mySqlScript += "sGuidBasePrice_Color_New,"; }
            if (this.a_sNameBasePrice_Color_New != null) { mySqlScript += "sNameBasePrice_Color_New,"; }
            if (this.a_sGuidBasePrice_Media_Specification_Old != null) { mySqlScript += "sGuidBasePrice_Media_Specification_Old,"; }
            if (this.a_sNameBasePrice_Media_Specification_Old != null) { mySqlScript += "sNameBasePrice_Media_Specification_Old,"; }
            if (this.a_sGuidBasePrice_Media_Specification_New != null) { mySqlScript += "sGuidBasePrice_Media_Specification_New,"; }
            if (this.a_sNameBasePrice_Media_Specification_New != null) { mySqlScript += "sNameBasePrice_Media_Specification_New,"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType_Old != null) { mySqlScript += "sGuidBasePrice_Media_PagePositionType_Old,"; }
            if (this.a_sNameBasePrice_Media_PagePositionType_Old != null) { mySqlScript += "sNameBasePrice_Media_PagePositionType_Old,"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType_New != null) { mySqlScript += "sGuidBasePrice_Media_PagePositionType_New,"; }
            if (this.a_sNameBasePrice_Media_PagePositionType_New != null) { mySqlScript += "sNameBasePrice_Media_PagePositionType_New,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkApplication_ChangeIssue != null) { mySqlScript += "'" + this.a_sGuidWorkApplication_ChangeIssue + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_s_Name_Flod_Old != null) { mySqlScript += "'" + this.a_s_Name_Flod_Old + "',"; }
            if (this.a_s_Name_Flod_New != null) { mySqlScript += "'" + this.a_s_Name_Flod_New + "',"; }
            if (this.a_s_Name_Page_Old != null) { mySqlScript += "'" + this.a_s_Name_Page_Old + "',"; }
            if (this.a_s_Name_Page_New != null) { mySqlScript += "'" + this.a_s_Name_Page_New + "',"; }
            if (this.a_sGuidBasePrice_Color_Old != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Color_Old + "',"; }
            if (this.a_sNameBasePrice_Color_Old != null) { mySqlScript += "'" + this.a_sNameBasePrice_Color_Old + "',"; }
            if (this.a_sGuidBasePrice_Color_New != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Color_New + "',"; }
            if (this.a_sNameBasePrice_Color_New != null) { mySqlScript += "'" + this.a_sNameBasePrice_Color_New + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification_Old != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_Specification_Old + "',"; }
            if (this.a_sNameBasePrice_Media_Specification_Old != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_Specification_Old + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification_New != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_Specification_New + "',"; }
            if (this.a_sNameBasePrice_Media_Specification_New != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_Specification_New + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType_Old != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_PagePositionType_Old + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType_Old != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_PagePositionType_Old + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType_New != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_PagePositionType_New + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType_New != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_PagePositionType_New + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_ChangeIssue_Details set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkApplication_ChangeIssue != null) { iColumnCount++; mySqlScript += " sGuidWorkApplication_ChangeIssue = '" + this.a_sGuidWorkApplication_ChangeIssue + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_s_Name_Flod_Old != null) { iColumnCount++; mySqlScript += " s_Name_Flod_Old = '" + this.a_s_Name_Flod_Old + "',"; }
            if (this.a_s_Name_Flod_New != null) { iColumnCount++; mySqlScript += " s_Name_Flod_New = '" + this.a_s_Name_Flod_New + "',"; }
            if (this.a_s_Name_Page_Old != null) { iColumnCount++; mySqlScript += " s_Name_Page_Old = '" + this.a_s_Name_Page_Old + "',"; }
            if (this.a_s_Name_Page_New != null) { iColumnCount++; mySqlScript += " s_Name_Page_New = '" + this.a_s_Name_Page_New + "',"; }
            if (this.a_sGuidBasePrice_Color_Old != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Color_Old = '" + this.a_sGuidBasePrice_Color_Old + "',"; }
            if (this.a_sNameBasePrice_Color_Old != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Color_Old = '" + this.a_sNameBasePrice_Color_Old + "',"; }
            if (this.a_sGuidBasePrice_Color_New != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Color_New = '" + this.a_sGuidBasePrice_Color_New + "',"; }
            if (this.a_sNameBasePrice_Color_New != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Color_New = '" + this.a_sNameBasePrice_Color_New + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification_Old != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_Specification_Old = '" + this.a_sGuidBasePrice_Media_Specification_Old + "',"; }
            if (this.a_sNameBasePrice_Media_Specification_Old != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_Specification_Old = '" + this.a_sNameBasePrice_Media_Specification_Old + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification_New != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_Specification_New = '" + this.a_sGuidBasePrice_Media_Specification_New + "',"; }
            if (this.a_sNameBasePrice_Media_Specification_New != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_Specification_New = '" + this.a_sNameBasePrice_Media_Specification_New + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType_Old != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_PagePositionType_Old = '" + this.a_sGuidBasePrice_Media_PagePositionType_Old + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType_Old != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_PagePositionType_Old = '" + this.a_sNameBasePrice_Media_PagePositionType_Old + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType_New != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_PagePositionType_New = '" + this.a_sGuidBasePrice_Media_PagePositionType_New + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType_New != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_PagePositionType_New = '" + this.a_sNameBasePrice_Media_PagePositionType_New + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_ChangeIssue_Details Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //业务员挂牌申请( WorkApplication_CRM_BelongEmployee )  
    /// <summary>
    /// 业务员挂牌申请
    /// </summary>
    public partial class Sql_WorkApplication_CRM_BelongEmployee
    {
        #region 与数据表(业务员挂牌申请)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 审批流程ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 审批状态 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 审批人 
        /// </summary> 
        public System.String a_sApprovalMan = null;
        /// <summary> 
        /// 审批日期 
        /// </summary> 
        public System.DateTime? a_dApprovalDate = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sApprovalMan != null) { this.a_sApprovalMan = ReplaceString.GetReplaceString(this.a_sApprovalMan); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_CRM_BelongEmployee( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "sApprovalMan,"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "dApprovalDate,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "'" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "'" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_CRM_BelongEmployee set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { iColumnCount++; mySqlScript += " sApprovalMan = '" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { iColumnCount++; mySqlScript += " dApprovalDate = '" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_CRM_BelongEmployee Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //业务员挂牌申请明细( WorkApplication_CRM_BelongEmployee_Details )  
    /// <summary>
    /// 业务员挂牌申请明细
    /// </summary>
    public partial class Sql_WorkApplication_CRM_BelongEmployee_Details
    {
        #region 与数据表(业务员挂牌申请明细)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 序号 
        /// </summary> 
        public System.Int32? a_iSort = null;
        /// <summary> 
        /// 申请ID 
        /// </summary> 
        public System.String a_sGuidWorkApplication_CRM_BelongEmployee = null;
        /// <summary> 
        /// 业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Employee = null;
        /// <summary> 
        /// 业务员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Employee = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkApplication_CRM_BelongEmployee != null) { this.a_sGuidWorkApplication_CRM_BelongEmployee = ReplaceString.GetReplaceString(this.a_sGuidWorkApplication_CRM_BelongEmployee); }
            if (this.a_sGuidBase_Department_Person_Employee != null) { this.a_sGuidBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Employee); }
            if (this.a_sNameBase_Department_Person_Employee != null) { this.a_sNameBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Employee); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_CRM_BelongEmployee_Details( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_iSort != null) { mySqlScript += "iSort,"; }
            if (this.a_sGuidWorkApplication_CRM_BelongEmployee != null) { mySqlScript += "sGuidWorkApplication_CRM_BelongEmployee,"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "sGuidBase_Department_Person_Employee,"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "sNameBase_Department_Person_Employee,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { mySqlScript += this.a_iSort + ","; }
            if (this.a_sGuidWorkApplication_CRM_BelongEmployee != null) { mySqlScript += "'" + this.a_sGuidWorkApplication_CRM_BelongEmployee + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_CRM_BelongEmployee_Details set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_iSort != null) { iColumnCount++; mySqlScript += " iSort = " + this.a_iSort + ","; }
            if (this.a_sGuidWorkApplication_CRM_BelongEmployee != null) { iColumnCount++; mySqlScript += " sGuidWorkApplication_CRM_BelongEmployee = '" + this.a_sGuidWorkApplication_CRM_BelongEmployee + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Employee = '" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Employee = '" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_CRM_BelongEmployee_Details Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //业务员摘牌申请( WorkApplication_CRM_CancelEmployee )  
    /// <summary>
    /// 业务员摘牌申请
    /// </summary>
    public partial class Sql_WorkApplication_CRM_CancelEmployee
    {
        #region 与数据表(业务员摘牌申请)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 审批流程ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 审批状态 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 审批人 
        /// </summary> 
        public System.String a_sApprovalMan = null;
        /// <summary> 
        /// 审批日期 
        /// </summary> 
        public System.DateTime? a_dApprovalDate = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sApprovalMan != null) { this.a_sApprovalMan = ReplaceString.GetReplaceString(this.a_sApprovalMan); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_CRM_CancelEmployee( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "sApprovalMan,"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "dApprovalDate,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "'" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "'" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_CRM_CancelEmployee set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { iColumnCount++; mySqlScript += " sApprovalMan = '" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { iColumnCount++; mySqlScript += " dApprovalDate = '" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_CRM_CancelEmployee Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //业务员摘牌申请明细( WorkApplication_CRM_CancelEmployee_Details )  
    /// <summary>
    /// 业务员摘牌申请明细
    /// </summary>
    public partial class Sql_WorkApplication_CRM_CancelEmployee_Details
    {
        #region 与数据表(业务员摘牌申请明细)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 申请ID 
        /// </summary> 
        public System.String a_sGuidWorkApplication_CRM_CancelEmployee = null;
        /// <summary> 
        /// 业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Employee = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 业务员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Employee = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkApplication_CRM_CancelEmployee != null) { this.a_sGuidWorkApplication_CRM_CancelEmployee = ReplaceString.GetReplaceString(this.a_sGuidWorkApplication_CRM_CancelEmployee); }
            if (this.a_sGuidBase_Department_Person_Employee != null) { this.a_sGuidBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Employee); }
            if (this.a_sNameBase_Department_Person_Employee != null) { this.a_sNameBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Employee); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_CRM_CancelEmployee_Details( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkApplication_CRM_CancelEmployee != null) { mySqlScript += "sGuidWorkApplication_CRM_CancelEmployee,"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "sGuidBase_Department_Person_Employee,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "sNameBase_Department_Person_Employee,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkApplication_CRM_CancelEmployee != null) { mySqlScript += "'" + this.a_sGuidWorkApplication_CRM_CancelEmployee + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_CRM_CancelEmployee_Details set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkApplication_CRM_CancelEmployee != null) { iColumnCount++; mySqlScript += " sGuidWorkApplication_CRM_CancelEmployee = '" + this.a_sGuidWorkApplication_CRM_CancelEmployee + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Employee = '" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Employee = '" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_CRM_CancelEmployee_Details Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //客户返回金申请( WorkApplication_CustomerReturnMoney )  
    /// <summary>
    /// 客户返回金申请
    /// </summary>
    public partial class Sql_WorkApplication_CustomerReturnMoney
    {
        #region 与数据表(客户返回金申请)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 审批流程ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 审批流程 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 开始日期 
        /// </summary> 
        public System.DateTime? a_dStartDate = null;
        /// <summary> 
        /// 结束日期 
        /// </summary> 
        public System.DateTime? a_dEndDate = null;
        /// <summary> 
        /// 签订总额 
        /// </summary> 
        public System.Double? a_nSignedMoneyTotal = null;
        /// <summary> 
        /// 返回金 
        /// </summary> 
        public System.Double? a_nReturnMoney = null;
        /// <summary> 
        /// 返回比例 
        /// </summary> 
        public System.Double? a_nReturnPercentage = null;
        /// <summary> 
        /// 审批人 
        /// </summary> 
        public System.String a_sApprovalMan = null;
        /// <summary> 
        /// 审批日期 
        /// </summary> 
        public System.DateTime? a_dApprovalDate = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sApprovalMan != null) { this.a_sApprovalMan = ReplaceString.GetReplaceString(this.a_sApprovalMan); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_CustomerReturnMoney( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_dStartDate != null) { mySqlScript += "dStartDate,"; }
            if (this.a_dEndDate != null) { mySqlScript += "dEndDate,"; }
            if (this.a_nSignedMoneyTotal != null) { mySqlScript += "nSignedMoneyTotal,"; }
            if (this.a_nReturnMoney != null) { mySqlScript += "nReturnMoney,"; }
            if (this.a_nReturnPercentage != null) { mySqlScript += "nReturnPercentage,"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "sApprovalMan,"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "dApprovalDate,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_dStartDate != null) { mySqlScript += "'" + this.a_dStartDate + "',"; }
            if (this.a_dEndDate != null) { mySqlScript += "'" + this.a_dEndDate + "',"; }
            if (this.a_nSignedMoneyTotal != null) { mySqlScript += this.a_nSignedMoneyTotal + ","; }
            if (this.a_nReturnMoney != null) { mySqlScript += this.a_nReturnMoney + ","; }
            if (this.a_nReturnPercentage != null) { mySqlScript += this.a_nReturnPercentage + ","; }
            if (this.a_sApprovalMan != null) { mySqlScript += "'" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "'" + this.a_dApprovalDate + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_CustomerReturnMoney set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_dStartDate != null) { iColumnCount++; mySqlScript += " dStartDate = '" + this.a_dStartDate + "',"; }
            if (this.a_dEndDate != null) { iColumnCount++; mySqlScript += " dEndDate = '" + this.a_dEndDate + "',"; }
            if (this.a_nSignedMoneyTotal != null) { iColumnCount++; mySqlScript += " nSignedMoneyTotal = " + this.a_nSignedMoneyTotal + ","; }
            if (this.a_nReturnMoney != null) { iColumnCount++; mySqlScript += " nReturnMoney = " + this.a_nReturnMoney + ","; }
            if (this.a_nReturnPercentage != null) { iColumnCount++; mySqlScript += " nReturnPercentage = " + this.a_nReturnPercentage + ","; }
            if (this.a_sApprovalMan != null) { iColumnCount++; mySqlScript += " sApprovalMan = '" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { iColumnCount++; mySqlScript += " dApprovalDate = '" + this.a_dApprovalDate + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_CustomerReturnMoney Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //客户返回金申请明细( WorkApplication_CustomerReturnMoney_Details )  
    /// <summary>
    /// 客户返回金申请明细
    /// </summary>
    public partial class Sql_WorkApplication_CustomerReturnMoney_Details
    {
        #region 与数据表(客户返回金申请明细)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 申请ID 
        /// </summary> 
        public System.String a_sGuidWorkApplication_CustomerReturnMoney = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 签订金额 
        /// </summary> 
        public System.Double? a_nSignedMoney = null;
        /// <summary> 
        /// 预刊日期 
        /// </summary> 
        public System.DateTime? a_dPublishedDate = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkApplication_CustomerReturnMoney != null) { this.a_sGuidWorkApplication_CustomerReturnMoney = ReplaceString.GetReplaceString(this.a_sGuidWorkApplication_CustomerReturnMoney); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_CustomerReturnMoney_Details( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkApplication_CustomerReturnMoney != null) { mySqlScript += "sGuidWorkApplication_CustomerReturnMoney,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_nSignedMoney != null) { mySqlScript += "nSignedMoney,"; }
            if (this.a_dPublishedDate != null) { mySqlScript += "dPublishedDate,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkApplication_CustomerReturnMoney != null) { mySqlScript += "'" + this.a_sGuidWorkApplication_CustomerReturnMoney + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_nSignedMoney != null) { mySqlScript += this.a_nSignedMoney + ","; }
            if (this.a_dPublishedDate != null) { mySqlScript += "'" + this.a_dPublishedDate + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_CustomerReturnMoney_Details set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkApplication_CustomerReturnMoney != null) { iColumnCount++; mySqlScript += " sGuidWorkApplication_CustomerReturnMoney = '" + this.a_sGuidWorkApplication_CustomerReturnMoney + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_nSignedMoney != null) { iColumnCount++; mySqlScript += " nSignedMoney = " + this.a_nSignedMoney + ","; }
            if (this.a_dPublishedDate != null) { iColumnCount++; mySqlScript += " dPublishedDate = '" + this.a_dPublishedDate + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_CustomerReturnMoney_Details Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //折扣申请( WorkApplication_Discount )  
    /// <summary>
    /// 折扣申请
    /// </summary>
    public partial class Sql_WorkApplication_Discount
    {
        #region 与数据表(折扣申请)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 申请日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 申请内容说明 
        /// </summary> 
        public System.String a_sContent = null;
        /// <summary> 
        /// 审批流程ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 审批状态(待审/在审/通过/否决/撤消) 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 审批人(通过的) 
        /// </summary> 
        public System.String a_sApprovalMan = null;
        /// <summary> 
        /// 审批通过日期 
        /// </summary> 
        public System.DateTime? a_dApprovalDate = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sContent != null) { this.a_sContent = ReplaceString.GetReplaceString(this.a_sContent); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sApprovalMan != null) { this.a_sApprovalMan = ReplaceString.GetReplaceString(this.a_sApprovalMan); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_Discount( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sContent != null) { mySqlScript += "sContent,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "sApprovalMan,"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "dApprovalDate,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sContent != null) { mySqlScript += "'" + this.a_sContent + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "'" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "'" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_Discount set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sContent != null) { iColumnCount++; mySqlScript += " sContent = '" + this.a_sContent + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { iColumnCount++; mySqlScript += " sApprovalMan = '" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { iColumnCount++; mySqlScript += " dApprovalDate = '" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_Discount Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //折扣申请明细( WorkApplication_Discount_Details )  
    /// <summary>
    /// 折扣申请明细
    /// </summary>
    public partial class Sql_WorkApplication_Discount_Details
    {
        #region 与数据表(折扣申请明细)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 申请ID 
        /// </summary> 
        public System.String a_sGuidWorkApplication_Discount = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 刊例金额 
        /// </summary> 
        public System.Double? a_n_Price_Standard = null;
        /// <summary> 
        /// 原来的签订金额 
        /// </summary> 
        public System.Double? a_n_Price_Signed_Old = null;
        /// <summary> 
        /// 新的签订金额 
        /// </summary> 
        public System.Double? a_n_Price_Signed_New = null;
        /// <summary> 
        /// 原来的折扣 
        /// </summary> 
        public System.Double? a_nDiscountProportion_Old = null;
        /// <summary> 
        /// 现在的折扣 
        /// </summary> 
        public System.Double? a_nDiscountProportion_New = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkApplication_Discount != null) { this.a_sGuidWorkApplication_Discount = ReplaceString.GetReplaceString(this.a_sGuidWorkApplication_Discount); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_Discount_Details( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkApplication_Discount != null) { mySqlScript += "sGuidWorkApplication_Discount,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_n_Price_Standard != null) { mySqlScript += "n_Price_Standard,"; }
            if (this.a_n_Price_Signed_Old != null) { mySqlScript += "n_Price_Signed_Old,"; }
            if (this.a_n_Price_Signed_New != null) { mySqlScript += "n_Price_Signed_New,"; }
            if (this.a_nDiscountProportion_Old != null) { mySqlScript += "nDiscountProportion_Old,"; }
            if (this.a_nDiscountProportion_New != null) { mySqlScript += "nDiscountProportion_New,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkApplication_Discount != null) { mySqlScript += "'" + this.a_sGuidWorkApplication_Discount + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_n_Price_Standard != null) { mySqlScript += this.a_n_Price_Standard + ","; }
            if (this.a_n_Price_Signed_Old != null) { mySqlScript += this.a_n_Price_Signed_Old + ","; }
            if (this.a_n_Price_Signed_New != null) { mySqlScript += this.a_n_Price_Signed_New + ","; }
            if (this.a_nDiscountProportion_Old != null) { mySqlScript += this.a_nDiscountProportion_Old + ","; }
            if (this.a_nDiscountProportion_New != null) { mySqlScript += this.a_nDiscountProportion_New + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_Discount_Details set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkApplication_Discount != null) { iColumnCount++; mySqlScript += " sGuidWorkApplication_Discount = '" + this.a_sGuidWorkApplication_Discount + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_n_Price_Standard != null) { iColumnCount++; mySqlScript += " n_Price_Standard = " + this.a_n_Price_Standard + ","; }
            if (this.a_n_Price_Signed_Old != null) { iColumnCount++; mySqlScript += " n_Price_Signed_Old = " + this.a_n_Price_Signed_Old + ","; }
            if (this.a_n_Price_Signed_New != null) { iColumnCount++; mySqlScript += " n_Price_Signed_New = " + this.a_n_Price_Signed_New + ","; }
            if (this.a_nDiscountProportion_Old != null) { iColumnCount++; mySqlScript += " nDiscountProportion_Old = " + this.a_nDiscountProportion_Old + ","; }
            if (this.a_nDiscountProportion_New != null) { iColumnCount++; mySqlScript += " nDiscountProportion_New = " + this.a_nDiscountProportion_New + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_Discount_Details Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //订单申请( WorkApplication_Order )  
    /// <summary>
    /// 订单申请
    /// </summary>
    public partial class Sql_WorkApplication_Order
    {
        #region 与数据表(订单申请)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 订单ID 
        /// </summary> 
        public System.String a_sGuidWorkOrder = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 流程ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 审批流程 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 审批人 
        /// </summary> 
        public System.String a_sApprovalMan = null;
        /// <summary> 
        /// 审批日期 
        /// </summary> 
        public System.DateTime? a_dApprovalDate = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkOrder != null) { this.a_sGuidWorkOrder = ReplaceString.GetReplaceString(this.a_sGuidWorkOrder); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sApprovalMan != null) { this.a_sApprovalMan = ReplaceString.GetReplaceString(this.a_sApprovalMan); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_Order( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkOrder != null) { mySqlScript += "sGuidWorkOrder,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "sApprovalMan,"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "dApprovalDate,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkOrder != null) { mySqlScript += "'" + this.a_sGuidWorkOrder + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "'" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "'" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_Order set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkOrder != null) { iColumnCount++; mySqlScript += " sGuidWorkOrder = '" + this.a_sGuidWorkOrder + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { iColumnCount++; mySqlScript += " sApprovalMan = '" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { iColumnCount++; mySqlScript += " dApprovalDate = '" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_Order Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //预开发票申请( WorkApplication_PriorInvoice )  
    /// <summary>
    /// 预开发票申请
    /// </summary>
    public partial class Sql_WorkApplication_PriorInvoice
    {
        #region 与数据表(预开发票申请)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 客户类型(客户/代理公司/代理人) 
        /// </summary> 
        public System.String a_sCustomersType = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Employee = null;
        /// <summary> 
        /// 业务员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Employee = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 发票项目(广告费/宣传费) 
        /// </summary> 
        public System.String a_sInvoiceItem = null;
        /// <summary> 
        /// 发票打印的客户名称 
        /// </summary> 
        public System.String a_sInvoiceCustomersName = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 审批状态(待审/在审/通过/否决/撤消) 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 审批流程ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 申请金额 
        /// </summary> 
        public System.Double? a_nApplicationMoney = null;
        /// <summary> 
        /// 发票张数 
        /// </summary> 
        public System.Int32? a_iInvoiceQuantity = null;
        /// <summary> 
        /// 计划还款日期 
        /// </summary> 
        public System.DateTime? a_dPlanRepaymentDate = null;
        /// <summary> 
        /// 审批人(通过的) 
        /// </summary> 
        public System.String a_sApprovalMan = null;
        /// <summary> 
        /// 审批时间(通过) 
        /// </summary> 
        public System.DateTime? a_dApprovalDate = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sCustomersType != null) { this.a_sCustomersType = ReplaceString.GetReplaceString(this.a_sCustomersType); }
            if (this.a_sGuidBase_Department_Person_Employee != null) { this.a_sGuidBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Employee); }
            if (this.a_sNameBase_Department_Person_Employee != null) { this.a_sNameBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Employee); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sInvoiceItem != null) { this.a_sInvoiceItem = ReplaceString.GetReplaceString(this.a_sInvoiceItem); }
            if (this.a_sInvoiceCustomersName != null) { this.a_sInvoiceCustomersName = ReplaceString.GetReplaceString(this.a_sInvoiceCustomersName); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sApprovalMan != null) { this.a_sApprovalMan = ReplaceString.GetReplaceString(this.a_sApprovalMan); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_PriorInvoice( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sCustomersType != null) { mySqlScript += "sCustomersType,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "sGuidBase_Department_Person_Employee,"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "sNameBase_Department_Person_Employee,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_sInvoiceItem != null) { mySqlScript += "sInvoiceItem,"; }
            if (this.a_sInvoiceCustomersName != null) { mySqlScript += "sInvoiceCustomersName,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_nApplicationMoney != null) { mySqlScript += "nApplicationMoney,"; }
            if (this.a_iInvoiceQuantity != null) { mySqlScript += "iInvoiceQuantity,"; }
            if (this.a_dPlanRepaymentDate != null) { mySqlScript += "dPlanRepaymentDate,"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "sApprovalMan,"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "dApprovalDate,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sCustomersType != null) { mySqlScript += "'" + this.a_sCustomersType + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sInvoiceItem != null) { mySqlScript += "'" + this.a_sInvoiceItem + "',"; }
            if (this.a_sInvoiceCustomersName != null) { mySqlScript += "'" + this.a_sInvoiceCustomersName + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_nApplicationMoney != null) { mySqlScript += this.a_nApplicationMoney + ","; }
            if (this.a_iInvoiceQuantity != null) { mySqlScript += this.a_iInvoiceQuantity + ","; }
            if (this.a_dPlanRepaymentDate != null) { mySqlScript += "'" + this.a_dPlanRepaymentDate + "',"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "'" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "'" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_PriorInvoice set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sCustomersType != null) { iColumnCount++; mySqlScript += " sCustomersType = '" + this.a_sCustomersType + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Employee = '" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Employee = '" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sInvoiceItem != null) { iColumnCount++; mySqlScript += " sInvoiceItem = '" + this.a_sInvoiceItem + "',"; }
            if (this.a_sInvoiceCustomersName != null) { iColumnCount++; mySqlScript += " sInvoiceCustomersName = '" + this.a_sInvoiceCustomersName + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_nApplicationMoney != null) { iColumnCount++; mySqlScript += " nApplicationMoney = " + this.a_nApplicationMoney + ","; }
            if (this.a_iInvoiceQuantity != null) { iColumnCount++; mySqlScript += " iInvoiceQuantity = " + this.a_iInvoiceQuantity + ","; }
            if (this.a_dPlanRepaymentDate != null) { iColumnCount++; mySqlScript += " dPlanRepaymentDate = '" + this.a_dPlanRepaymentDate + "',"; }
            if (this.a_sApprovalMan != null) { iColumnCount++; mySqlScript += " sApprovalMan = '" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { iColumnCount++; mySqlScript += " dApprovalDate = '" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_PriorInvoice Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //预开发票申请明细( WorkApplication_PriorInvoice_Details )  
    /// <summary>
    /// 预开发票申请明细
    /// </summary>
    public partial class Sql_WorkApplication_PriorInvoice_Details
    {
        #region 与数据表(预开发票申请明细)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 申请ID 
        /// </summary> 
        public System.String a_sGuidWorkApplication_PriorInvoice = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 付款客户名称 
        /// </summary> 
        public System.String a_sPaymentCustomersName = null;
        /// <summary> 
        /// 订单欠款额 
        /// </summary> 
        public System.Double? a_nOrderArrearsMoney = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkApplication_PriorInvoice != null) { this.a_sGuidWorkApplication_PriorInvoice = ReplaceString.GetReplaceString(this.a_sGuidWorkApplication_PriorInvoice); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sPaymentCustomersName != null) { this.a_sPaymentCustomersName = ReplaceString.GetReplaceString(this.a_sPaymentCustomersName); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_PriorInvoice_Details( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkApplication_PriorInvoice != null) { mySqlScript += "sGuidWorkApplication_PriorInvoice,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_sPaymentCustomersName != null) { mySqlScript += "sPaymentCustomersName,"; }
            if (this.a_nOrderArrearsMoney != null) { mySqlScript += "nOrderArrearsMoney,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkApplication_PriorInvoice != null) { mySqlScript += "'" + this.a_sGuidWorkApplication_PriorInvoice + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sPaymentCustomersName != null) { mySqlScript += "'" + this.a_sPaymentCustomersName + "',"; }
            if (this.a_nOrderArrearsMoney != null) { mySqlScript += this.a_nOrderArrearsMoney + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_PriorInvoice_Details set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkApplication_PriorInvoice != null) { iColumnCount++; mySqlScript += " sGuidWorkApplication_PriorInvoice = '" + this.a_sGuidWorkApplication_PriorInvoice + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sPaymentCustomersName != null) { iColumnCount++; mySqlScript += " sPaymentCustomersName = '" + this.a_sPaymentCustomersName + "',"; }
            if (this.a_nOrderArrearsMoney != null) { iColumnCount++; mySqlScript += " nOrderArrearsMoney = " + this.a_nOrderArrearsMoney + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_PriorInvoice_Details Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //退款申请( WorkApplication_Refundment )  
    /// <summary>
    /// 退款申请
    /// </summary>
    public partial class Sql_WorkApplication_Refundment
    {
        #region 与数据表(退款申请)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_Refundment( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_Refundment set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_Refundment Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //销售活动报告申请( WorkApplication_Sales_WorkReport )  
    /// <summary>
    /// 销售活动报告申请
    /// </summary>
    public partial class Sql_WorkApplication_Sales_WorkReport
    {
        #region 与数据表(销售活动报告申请)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 工作报告ID 
        /// </summary> 
        public System.String a_sGuidWorkSales_WorkReport = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 创建时间 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 流程ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 审批状态 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 审批人 
        /// </summary> 
        public System.String a_sApprovalMan = null;
        /// <summary> 
        /// 审批时间 
        /// </summary> 
        public System.DateTime? a_dApprovalDate = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkSales_WorkReport != null) { this.a_sGuidWorkSales_WorkReport = ReplaceString.GetReplaceString(this.a_sGuidWorkSales_WorkReport); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sApprovalMan != null) { this.a_sApprovalMan = ReplaceString.GetReplaceString(this.a_sApprovalMan); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_Sales_WorkReport( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkSales_WorkReport != null) { mySqlScript += "sGuidWorkSales_WorkReport,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "sApprovalMan,"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "dApprovalDate,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkSales_WorkReport != null) { mySqlScript += "'" + this.a_sGuidWorkSales_WorkReport + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "'" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "'" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_Sales_WorkReport set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkSales_WorkReport != null) { iColumnCount++; mySqlScript += " sGuidWorkSales_WorkReport = '" + this.a_sGuidWorkSales_WorkReport + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { iColumnCount++; mySqlScript += " sApprovalMan = '" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { iColumnCount++; mySqlScript += " dApprovalDate = '" + this.a_dApprovalDate + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_Sales_WorkReport Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //销售项目申请( WorkApplication_SalesItemReport )  
    /// <summary>
    /// 销售项目申请
    /// </summary>
    public partial class Sql_WorkApplication_SalesItemReport
    {
        #region 与数据表(销售项目申请)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_SalesItemReport( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_SalesItemReport set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_SalesItemReport Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //销售活动报告申请明细( WorkApplication_SalesItemReport_Details )  
    /// <summary>
    /// 销售活动报告申请明细
    /// </summary>
    public partial class Sql_WorkApplication_SalesItemReport_Details
    {
        #region 与数据表(销售活动报告申请明细)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_SalesItemReport_Details( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_SalesItemReport_Details set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_SalesItemReport_Details Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //停刊申请( WorkApplication_StopIssue )  
    /// <summary>
    /// 停刊申请
    /// </summary>
    public partial class Sql_WorkApplication_StopIssue
    {
        #region 与数据表(停刊申请)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 审批流程ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 审批状态 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 审批人 
        /// </summary> 
        public System.String a_sApprovalMan = null;
        /// <summary> 
        /// 审批时间 
        /// </summary> 
        public System.DateTime? a_dApprovalDate = null;
        /// <summary> 
        /// 申请内容 
        /// </summary> 
        public System.String a_sContent = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sApprovalMan != null) { this.a_sApprovalMan = ReplaceString.GetReplaceString(this.a_sApprovalMan); }
            if (this.a_sContent != null) { this.a_sContent = ReplaceString.GetReplaceString(this.a_sContent); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_StopIssue( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "sApprovalMan,"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "dApprovalDate,"; }
            if (this.a_sContent != null) { mySqlScript += "sContent,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { mySqlScript += "'" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { mySqlScript += "'" + this.a_dApprovalDate + "',"; }
            if (this.a_sContent != null) { mySqlScript += "'" + this.a_sContent + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_StopIssue set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_sApprovalMan != null) { iColumnCount++; mySqlScript += " sApprovalMan = '" + this.a_sApprovalMan + "',"; }
            if (this.a_dApprovalDate != null) { iColumnCount++; mySqlScript += " dApprovalDate = '" + this.a_dApprovalDate + "',"; }
            if (this.a_sContent != null) { iColumnCount++; mySqlScript += " sContent = '" + this.a_sContent + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_StopIssue Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //停刊申请明细( WorkApplication_StopIssue_Details )  
    /// <summary>
    /// 停刊申请明细
    /// </summary>
    public partial class Sql_WorkApplication_StopIssue_Details
    {
        #region 与数据表(停刊申请明细)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 申请ID 
        /// </summary> 
        public System.String a_sGuidWorkApplication_StopIssue = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 客户名称 
        /// </summary> 
        public System.String a_sCustomerName = null;
        /// <summary> 
        /// 广告标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 刊出日期 
        /// </summary> 
        public System.DateTime? a_dIssueDate = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkApplication_StopIssue != null) { this.a_sGuidWorkApplication_StopIssue = ReplaceString.GetReplaceString(this.a_sGuidWorkApplication_StopIssue); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sCustomerName != null) { this.a_sCustomerName = ReplaceString.GetReplaceString(this.a_sCustomerName); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApplication_StopIssue_Details( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkApplication_StopIssue != null) { mySqlScript += "sGuidWorkApplication_StopIssue,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_sCustomerName != null) { mySqlScript += "sCustomerName,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_dIssueDate != null) { mySqlScript += "dIssueDate,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkApplication_StopIssue != null) { mySqlScript += "'" + this.a_sGuidWorkApplication_StopIssue + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sCustomerName != null) { mySqlScript += "'" + this.a_sCustomerName + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_dIssueDate != null) { mySqlScript += "'" + this.a_dIssueDate + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApplication_StopIssue_Details set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkApplication_StopIssue != null) { iColumnCount++; mySqlScript += " sGuidWorkApplication_StopIssue = '" + this.a_sGuidWorkApplication_StopIssue + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sCustomerName != null) { iColumnCount++; mySqlScript += " sCustomerName = '" + this.a_sCustomerName + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_dIssueDate != null) { iColumnCount++; mySqlScript += " dIssueDate = '" + this.a_dIssueDate + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApplication_StopIssue_Details Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //审批步骤( WorkApprovalStep )  
    /// <summary>
    /// 审批步骤
    /// </summary>
    public partial class Sql_WorkApprovalStep
    {
        #region 与数据表(审批步骤)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 申请类型(广告订单/改判归属/客户挂牌/客户摘牌/预开发票/广告改刊/广告停刊/广告加刊/广告退款/工作报告/广告折扣/客户返回金/刊后付款) 
        /// </summary> 
        public System.String a_sApplicationType = null;
        /// <summary> 
        /// 申请ID 
        /// </summary> 
        public System.String a_s_GuidApplication = null;
        /// <summary> 
        /// 审批意见 
        /// </summary> 
        public System.String a_sApprovalComments = null;
        /// <summary> 
        /// 审批状态(待审/通过/否决/撤消) 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 审批步骤ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess_Step = null;
        /// <summary> 
        /// 审批人姓名 
        /// </summary> 
        public System.String a_s_NameApprovalMan = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sApplicationType != null) { this.a_sApplicationType = ReplaceString.GetReplaceString(this.a_sApplicationType); }
            if (this.a_s_GuidApplication != null) { this.a_s_GuidApplication = ReplaceString.GetReplaceString(this.a_s_GuidApplication); }
            if (this.a_sApprovalComments != null) { this.a_sApprovalComments = ReplaceString.GetReplaceString(this.a_sApprovalComments); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sGuidBaseApprovalProcess_Step != null) { this.a_sGuidBaseApprovalProcess_Step = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess_Step); }
            if (this.a_s_NameApprovalMan != null) { this.a_s_NameApprovalMan = ReplaceString.GetReplaceString(this.a_s_NameApprovalMan); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApprovalStep( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sApplicationType != null) { mySqlScript += "sApplicationType,"; }
            if (this.a_s_GuidApplication != null) { mySqlScript += "s_GuidApplication,"; }
            if (this.a_sApprovalComments != null) { mySqlScript += "sApprovalComments,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_sGuidBaseApprovalProcess_Step != null) { mySqlScript += "sGuidBaseApprovalProcess_Step,"; }
            if (this.a_s_NameApprovalMan != null) { mySqlScript += "s_NameApprovalMan,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sApplicationType != null) { mySqlScript += "'" + this.a_sApplicationType + "',"; }
            if (this.a_s_GuidApplication != null) { mySqlScript += "'" + this.a_s_GuidApplication + "',"; }
            if (this.a_sApprovalComments != null) { mySqlScript += "'" + this.a_sApprovalComments + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_sGuidBaseApprovalProcess_Step != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess_Step + "',"; }
            if (this.a_s_NameApprovalMan != null) { mySqlScript += "'" + this.a_s_NameApprovalMan + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApprovalStep set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sApplicationType != null) { iColumnCount++; mySqlScript += " sApplicationType = '" + this.a_sApplicationType + "',"; }
            if (this.a_s_GuidApplication != null) { iColumnCount++; mySqlScript += " s_GuidApplication = '" + this.a_s_GuidApplication + "',"; }
            if (this.a_sApprovalComments != null) { iColumnCount++; mySqlScript += " sApprovalComments = '" + this.a_sApprovalComments + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_sGuidBaseApprovalProcess_Step != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess_Step = '" + this.a_sGuidBaseApprovalProcess_Step + "',"; }
            if (this.a_s_NameApprovalMan != null) { iColumnCount++; mySqlScript += " s_NameApprovalMan = '" + this.a_s_NameApprovalMan + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApprovalStep Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //审批人( WorkApprovalStep_Person )  
    /// <summary>
    /// 审批人
    /// </summary>
    public partial class Sql_WorkApprovalStep_Person
    {
        #region 与数据表(审批人)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 审批步骤 
        /// </summary> 
        public System.String a_sGuidWorkApprovalStep = null;
        /// <summary> 
        /// 审批状态(待审/在审/通过/否决/撤消) 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 审批人ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 审批意见 
        /// </summary> 
        public System.String a_sApprovalComments = null;
        /// <summary> 
        /// 审批步骤序号(没有更大的则通过流程) 
        /// </summary> 
        public System.Int32? a_iWorkApprovalStepSort = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkApprovalStep != null) { this.a_sGuidWorkApprovalStep = ReplaceString.GetReplaceString(this.a_sGuidWorkApprovalStep); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sApprovalComments != null) { this.a_sApprovalComments = ReplaceString.GetReplaceString(this.a_sApprovalComments); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkApprovalStep_Person( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkApprovalStep != null) { mySqlScript += "sGuidWorkApprovalStep,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_sApprovalComments != null) { mySqlScript += "sApprovalComments,"; }
            if (this.a_iWorkApprovalStepSort != null) { mySqlScript += "iWorkApprovalStepSort,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkApprovalStep != null) { mySqlScript += "'" + this.a_sGuidWorkApprovalStep + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sApprovalComments != null) { mySqlScript += "'" + this.a_sApprovalComments + "',"; }
            if (this.a_iWorkApprovalStepSort != null) { mySqlScript += this.a_iWorkApprovalStepSort + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkApprovalStep_Person set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkApprovalStep != null) { iColumnCount++; mySqlScript += " sGuidWorkApprovalStep = '" + this.a_sGuidWorkApprovalStep + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sApprovalComments != null) { iColumnCount++; mySqlScript += " sApprovalComments = '" + this.a_sApprovalComments + "',"; }
            if (this.a_iWorkApprovalStepSort != null) { iColumnCount++; mySqlScript += " iWorkApprovalStepSort = " + this.a_iWorkApprovalStepSort + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkApprovalStep_Person Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //催款单( WorkArrears_PaymentNotice )  
    /// <summary>
    /// 催款单
    /// </summary>
    public partial class Sql_WorkArrears_PaymentNotice
    {
        #region 与数据表(催款单)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkArrears_PaymentNotice( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkArrears_PaymentNotice set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkArrears_PaymentNotice Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //催款单明细( WorkArrears_PaymentNotice_Details )  
    /// <summary>
    /// 催款单明细
    /// </summary>
    public partial class Sql_WorkArrears_PaymentNotice_Details
    {
        #region 与数据表(催款单明细)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkArrears_PaymentNotice_Details( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkArrears_PaymentNotice_Details set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkArrears_PaymentNotice_Details Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //收费表( WorkCharge )  
    /// <summary>
    /// 收费表
    /// </summary>
    public partial class Sql_WorkCharge
    {
        #region 与数据表(收费表)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 发票号 
        /// </summary> 
        public System.String a_sInvoiceNum = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 客户名称 
        /// </summary> 
        public System.String a_sNameBaseCRM_Customer = null;
        /// <summary> 
        /// 收款方式ID 
        /// </summary> 
        public System.String a_sGuidInfoBaseFinance_ReceiveMoneyMode = null;
        /// <summary> 
        /// 收款方式 
        /// </summary> 
        public System.String a_sNameInfoBaseFinance_ReceiveMoneyMode = null;
        /// <summary> 
        /// 付款人 
        /// </summary> 
        public System.String a_sPaymentMan = null;
        /// <summary> 
        /// 发票单位 
        /// </summary> 
        public System.String a_sInvoiceUnits = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 收费项目 
        /// </summary> 
        public System.String a_sReceiveMoneyItem = null;
        /// <summary> 
        /// 定金 
        /// </summary> 
        public System.Boolean? a_bEarnest = null;
        /// <summary> 
        /// 收款日期 
        /// </summary> 
        public System.DateTime? a_dReceiveMoneyDate = null;
        /// <summary> 
        /// 收款金额 
        /// </summary> 
        public System.Double? a_nReceiveMoney = null;
        /// <summary> 
        /// 平帐金额 
        /// </summary> 
        public System.Double? a_nUseMoney = null;
        /// <summary> 
        /// 银行 
        /// </summary> 
        public System.String a_sBank = null;
        /// <summary> 
        /// 支票号 
        /// </summary> 
        public System.String a_sCheckNum = null;
        /// <summary> 
        /// 收款类型 
        /// </summary> 
        public System.String a_sNameInfoReceivedMoneyType = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 行版本 
        /// </summary> 
        public System.String a_RowVersion = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sInvoiceNum != null) { this.a_sInvoiceNum = ReplaceString.GetReplaceString(this.a_sInvoiceNum); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sNameBaseCRM_Customer != null) { this.a_sNameBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sNameBaseCRM_Customer); }
            if (this.a_sGuidInfoBaseFinance_ReceiveMoneyMode != null) { this.a_sGuidInfoBaseFinance_ReceiveMoneyMode = ReplaceString.GetReplaceString(this.a_sGuidInfoBaseFinance_ReceiveMoneyMode); }
            if (this.a_sNameInfoBaseFinance_ReceiveMoneyMode != null) { this.a_sNameInfoBaseFinance_ReceiveMoneyMode = ReplaceString.GetReplaceString(this.a_sNameInfoBaseFinance_ReceiveMoneyMode); }
            if (this.a_sPaymentMan != null) { this.a_sPaymentMan = ReplaceString.GetReplaceString(this.a_sPaymentMan); }
            if (this.a_sInvoiceUnits != null) { this.a_sInvoiceUnits = ReplaceString.GetReplaceString(this.a_sInvoiceUnits); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sReceiveMoneyItem != null) { this.a_sReceiveMoneyItem = ReplaceString.GetReplaceString(this.a_sReceiveMoneyItem); }
            if (this.a_sBank != null) { this.a_sBank = ReplaceString.GetReplaceString(this.a_sBank); }
            if (this.a_sCheckNum != null) { this.a_sCheckNum = ReplaceString.GetReplaceString(this.a_sCheckNum); }
            if (this.a_sNameInfoReceivedMoneyType != null) { this.a_sNameInfoReceivedMoneyType = ReplaceString.GetReplaceString(this.a_sNameInfoReceivedMoneyType); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkCharge( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sInvoiceNum != null) { mySqlScript += "sInvoiceNum,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_sNameBaseCRM_Customer != null) { mySqlScript += "sNameBaseCRM_Customer,"; }
            if (this.a_sGuidInfoBaseFinance_ReceiveMoneyMode != null) { mySqlScript += "sGuidInfoBaseFinance_ReceiveMoneyMode,"; }
            if (this.a_sNameInfoBaseFinance_ReceiveMoneyMode != null) { mySqlScript += "sNameInfoBaseFinance_ReceiveMoneyMode,"; }
            if (this.a_sPaymentMan != null) { mySqlScript += "sPaymentMan,"; }
            if (this.a_sInvoiceUnits != null) { mySqlScript += "sInvoiceUnits,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sReceiveMoneyItem != null) { mySqlScript += "sReceiveMoneyItem,"; }
            if (this.a_bEarnest != null) { mySqlScript += "bEarnest,"; }
            if (this.a_dReceiveMoneyDate != null) { mySqlScript += "dReceiveMoneyDate,"; }
            if (this.a_nReceiveMoney != null) { mySqlScript += "nReceiveMoney,"; }
            if (this.a_nUseMoney != null) { mySqlScript += "nUseMoney,"; }
            if (this.a_sBank != null) { mySqlScript += "sBank,"; }
            if (this.a_sCheckNum != null) { mySqlScript += "sCheckNum,"; }
            if (this.a_sNameInfoReceivedMoneyType != null) { mySqlScript += "sNameInfoReceivedMoneyType,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_RowVersion != null) { mySqlScript += "RowVersion,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sInvoiceNum != null) { mySqlScript += "'" + this.a_sInvoiceNum + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sNameBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sNameBaseCRM_Customer + "',"; }
            if (this.a_sGuidInfoBaseFinance_ReceiveMoneyMode != null) { mySqlScript += "'" + this.a_sGuidInfoBaseFinance_ReceiveMoneyMode + "',"; }
            if (this.a_sNameInfoBaseFinance_ReceiveMoneyMode != null) { mySqlScript += "'" + this.a_sNameInfoBaseFinance_ReceiveMoneyMode + "',"; }
            if (this.a_sPaymentMan != null) { mySqlScript += "'" + this.a_sPaymentMan + "',"; }
            if (this.a_sInvoiceUnits != null) { mySqlScript += "'" + this.a_sInvoiceUnits + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sReceiveMoneyItem != null) { mySqlScript += "'" + this.a_sReceiveMoneyItem + "',"; }
            if (this.a_bEarnest != null) { mySqlScript += "'" + this.a_bEarnest + "',"; }
            if (this.a_dReceiveMoneyDate != null) { mySqlScript += "'" + this.a_dReceiveMoneyDate + "',"; }
            if (this.a_nReceiveMoney != null) { mySqlScript += this.a_nReceiveMoney + ","; }
            if (this.a_nUseMoney != null) { mySqlScript += this.a_nUseMoney + ","; }
            if (this.a_sBank != null) { mySqlScript += "'" + this.a_sBank + "',"; }
            if (this.a_sCheckNum != null) { mySqlScript += "'" + this.a_sCheckNum + "',"; }
            if (this.a_sNameInfoReceivedMoneyType != null) { mySqlScript += "'" + this.a_sNameInfoReceivedMoneyType + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_RowVersion != null) { mySqlScript += "'" + this.a_RowVersion + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkCharge set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sInvoiceNum != null) { iColumnCount++; mySqlScript += " sInvoiceNum = '" + this.a_sInvoiceNum + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sNameBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sNameBaseCRM_Customer = '" + this.a_sNameBaseCRM_Customer + "',"; }
            if (this.a_sGuidInfoBaseFinance_ReceiveMoneyMode != null) { iColumnCount++; mySqlScript += " sGuidInfoBaseFinance_ReceiveMoneyMode = '" + this.a_sGuidInfoBaseFinance_ReceiveMoneyMode + "',"; }
            if (this.a_sNameInfoBaseFinance_ReceiveMoneyMode != null) { iColumnCount++; mySqlScript += " sNameInfoBaseFinance_ReceiveMoneyMode = '" + this.a_sNameInfoBaseFinance_ReceiveMoneyMode + "',"; }
            if (this.a_sPaymentMan != null) { iColumnCount++; mySqlScript += " sPaymentMan = '" + this.a_sPaymentMan + "',"; }
            if (this.a_sInvoiceUnits != null) { iColumnCount++; mySqlScript += " sInvoiceUnits = '" + this.a_sInvoiceUnits + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sReceiveMoneyItem != null) { iColumnCount++; mySqlScript += " sReceiveMoneyItem = '" + this.a_sReceiveMoneyItem + "',"; }
            if (this.a_bEarnest != null) { iColumnCount++; mySqlScript += " bEarnest = '" + this.a_bEarnest + "',"; }
            if (this.a_dReceiveMoneyDate != null) { iColumnCount++; mySqlScript += " dReceiveMoneyDate = '" + this.a_dReceiveMoneyDate + "',"; }
            if (this.a_nReceiveMoney != null) { iColumnCount++; mySqlScript += " nReceiveMoney = " + this.a_nReceiveMoney + ","; }
            if (this.a_nUseMoney != null) { iColumnCount++; mySqlScript += " nUseMoney = " + this.a_nUseMoney + ","; }
            if (this.a_sBank != null) { iColumnCount++; mySqlScript += " sBank = '" + this.a_sBank + "',"; }
            if (this.a_sCheckNum != null) { iColumnCount++; mySqlScript += " sCheckNum = '" + this.a_sCheckNum + "',"; }
            if (this.a_sNameInfoReceivedMoneyType != null) { iColumnCount++; mySqlScript += " sNameInfoReceivedMoneyType = '" + this.a_sNameInfoReceivedMoneyType + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_RowVersion != null) { iColumnCount++; mySqlScript += " RowVersion = '" + this.a_RowVersion + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkCharge Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //开出的发票( WorkCharge_Invoice )  
    /// <summary>
    /// 开出的发票
    /// </summary>
    public partial class Sql_WorkCharge_Invoice
    {
        #region 与数据表(开出的发票)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 开票日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 收款表 
        /// </summary> 
        public System.String a_sGuidWorkCharge = null;
        /// <summary> 
        /// 发票号码 
        /// </summary> 
        public System.String a_sInvoiceNum = null;
        /// <summary> 
        /// 发票金额 
        /// </summary> 
        public System.Double? a_nInvoiceMoney = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkCharge != null) { this.a_sGuidWorkCharge = ReplaceString.GetReplaceString(this.a_sGuidWorkCharge); }
            if (this.a_sInvoiceNum != null) { this.a_sInvoiceNum = ReplaceString.GetReplaceString(this.a_sInvoiceNum); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkCharge_Invoice( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkCharge != null) { mySqlScript += "sGuidWorkCharge,"; }
            if (this.a_sInvoiceNum != null) { mySqlScript += "sInvoiceNum,"; }
            if (this.a_nInvoiceMoney != null) { mySqlScript += "nInvoiceMoney,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkCharge != null) { mySqlScript += "'" + this.a_sGuidWorkCharge + "',"; }
            if (this.a_sInvoiceNum != null) { mySqlScript += "'" + this.a_sInvoiceNum + "',"; }
            if (this.a_nInvoiceMoney != null) { mySqlScript += this.a_nInvoiceMoney + ","; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkCharge_Invoice set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkCharge != null) { iColumnCount++; mySqlScript += " sGuidWorkCharge = '" + this.a_sGuidWorkCharge + "',"; }
            if (this.a_sInvoiceNum != null) { iColumnCount++; mySqlScript += " sInvoiceNum = '" + this.a_sInvoiceNum + "',"; }
            if (this.a_nInvoiceMoney != null) { iColumnCount++; mySqlScript += " nInvoiceMoney = " + this.a_nInvoiceMoney + ","; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkCharge_Invoice Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //发票表( WorkInvoice )  
    /// <summary>
    /// 发票表
    /// </summary>
    public partial class Sql_WorkInvoice
    {
        #region 与数据表(发票表)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkInvoice( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkInvoice set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkInvoice Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //预开的发票( WorkInvoice_PriorWrite )  
    /// <summary>
    /// 预开的发票
    /// </summary>
    public partial class Sql_WorkInvoice_PriorWrite
    {
        #region 与数据表(预开的发票)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 发票号 
        /// </summary> 
        public System.String a_sInvoiceNum = null;
        /// <summary> 
        /// 发票日期 
        /// </summary> 
        public System.DateTime? a_dInvoiceDate = null;
        /// <summary> 
        /// 还款日期 
        /// </summary> 
        public System.DateTime? a_dReturnDate = null;
        /// <summary> 
        /// 发票单位 
        /// </summary> 
        public System.String a_sInvoiceUnits = null;
        /// <summary> 
        /// 发票金额 
        /// </summary> 
        public System.Double? a_nInvoiceMoney = null;
        /// <summary> 
        /// 收款金额 
        /// </summary> 
        public System.Double? a_nReceiveMoney = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sInvoiceNum != null) { this.a_sInvoiceNum = ReplaceString.GetReplaceString(this.a_sInvoiceNum); }
            if (this.a_sInvoiceUnits != null) { this.a_sInvoiceUnits = ReplaceString.GetReplaceString(this.a_sInvoiceUnits); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkInvoice_PriorWrite( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sInvoiceNum != null) { mySqlScript += "sInvoiceNum,"; }
            if (this.a_dInvoiceDate != null) { mySqlScript += "dInvoiceDate,"; }
            if (this.a_dReturnDate != null) { mySqlScript += "dReturnDate,"; }
            if (this.a_sInvoiceUnits != null) { mySqlScript += "sInvoiceUnits,"; }
            if (this.a_nInvoiceMoney != null) { mySqlScript += "nInvoiceMoney,"; }
            if (this.a_nReceiveMoney != null) { mySqlScript += "nReceiveMoney,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sInvoiceNum != null) { mySqlScript += "'" + this.a_sInvoiceNum + "',"; }
            if (this.a_dInvoiceDate != null) { mySqlScript += "'" + this.a_dInvoiceDate + "',"; }
            if (this.a_dReturnDate != null) { mySqlScript += "'" + this.a_dReturnDate + "',"; }
            if (this.a_sInvoiceUnits != null) { mySqlScript += "'" + this.a_sInvoiceUnits + "',"; }
            if (this.a_nInvoiceMoney != null) { mySqlScript += this.a_nInvoiceMoney + ","; }
            if (this.a_nReceiveMoney != null) { mySqlScript += this.a_nReceiveMoney + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkInvoice_PriorWrite set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sInvoiceNum != null) { iColumnCount++; mySqlScript += " sInvoiceNum = '" + this.a_sInvoiceNum + "',"; }
            if (this.a_dInvoiceDate != null) { iColumnCount++; mySqlScript += " dInvoiceDate = '" + this.a_dInvoiceDate + "',"; }
            if (this.a_dReturnDate != null) { iColumnCount++; mySqlScript += " dReturnDate = '" + this.a_dReturnDate + "',"; }
            if (this.a_sInvoiceUnits != null) { iColumnCount++; mySqlScript += " sInvoiceUnits = '" + this.a_sInvoiceUnits + "',"; }
            if (this.a_nInvoiceMoney != null) { iColumnCount++; mySqlScript += " nInvoiceMoney = " + this.a_nInvoiceMoney + ","; }
            if (this.a_nReceiveMoney != null) { iColumnCount++; mySqlScript += " nReceiveMoney = " + this.a_nReceiveMoney + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkInvoice_PriorWrite Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //消息内容( WorkMessageContent )  
    /// <summary>
    /// 消息内容
    /// </summary>
    public partial class Sql_WorkMessageContent
    {
        #region 与数据表(消息内容)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 类型(Syetem/Artificial 系统消息还是人工消息) 
        /// </summary> 
        public System.String a_sType = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 内容 
        /// </summary> 
        public System.String a_sContent = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 处理信息(如:XX已经处理) 
        /// </summary> 
        public System.String a_sHandleInfo = null;
        /// <summary> 
        /// 链接的功能地址 
        /// </summary> 
        public System.String a_sFeaturesURL = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sType != null) { this.a_sType = ReplaceString.GetReplaceString(this.a_sType); }
            if (this.a_sContent != null) { this.a_sContent = ReplaceString.GetReplaceString(this.a_sContent); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sHandleInfo != null) { this.a_sHandleInfo = ReplaceString.GetReplaceString(this.a_sHandleInfo); }
            if (this.a_sFeaturesURL != null) { this.a_sFeaturesURL = ReplaceString.GetReplaceString(this.a_sFeaturesURL); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkMessageContent( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sType != null) { mySqlScript += "sType,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sContent != null) { mySqlScript += "sContent,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sHandleInfo != null) { mySqlScript += "sHandleInfo,"; }
            if (this.a_sFeaturesURL != null) { mySqlScript += "sFeaturesURL,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { mySqlScript += "'" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sContent != null) { mySqlScript += "'" + this.a_sContent + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sHandleInfo != null) { mySqlScript += "'" + this.a_sHandleInfo + "',"; }
            if (this.a_sFeaturesURL != null) { mySqlScript += "'" + this.a_sFeaturesURL + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkMessageContent set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sType != null) { iColumnCount++; mySqlScript += " sType = '" + this.a_sType + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sContent != null) { iColumnCount++; mySqlScript += " sContent = '" + this.a_sContent + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sHandleInfo != null) { iColumnCount++; mySqlScript += " sHandleInfo = '" + this.a_sHandleInfo + "',"; }
            if (this.a_sFeaturesURL != null) { iColumnCount++; mySqlScript += " sFeaturesURL = '" + this.a_sFeaturesURL + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkMessageContent Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //消息接收人( WorkMessageContent_ReceiveMan )  
    /// <summary>
    /// 消息接收人
    /// </summary>
    public partial class Sql_WorkMessageContent_ReceiveMan
    {
        #region 与数据表(消息接收人)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 接收时间 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 消息体ID 
        /// </summary> 
        public System.String a_sGuidWorkMessageContent = null;
        /// <summary> 
        /// 接收人ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 接收人 
        /// </summary> 
        public System.String a_sNameBase_Department_Person = null;
        /// <summary> 
        /// 已读标志 
        /// </summary> 
        public System.Boolean? a_bRead = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkMessageContent != null) { this.a_sGuidWorkMessageContent = ReplaceString.GetReplaceString(this.a_sGuidWorkMessageContent); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sNameBase_Department_Person != null) { this.a_sNameBase_Department_Person = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkMessageContent_ReceiveMan( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkMessageContent != null) { mySqlScript += "sGuidWorkMessageContent,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "sNameBase_Department_Person,"; }
            if (this.a_bRead != null) { mySqlScript += "bRead,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkMessageContent != null) { mySqlScript += "'" + this.a_sGuidWorkMessageContent + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_bRead != null) { mySqlScript += "'" + this.a_bRead + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkMessageContent_ReceiveMan set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkMessageContent != null) { iColumnCount++; mySqlScript += " sGuidWorkMessageContent = '" + this.a_sGuidWorkMessageContent + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person = '" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_bRead != null) { iColumnCount++; mySqlScript += " bRead = '" + this.a_bRead + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkMessageContent_ReceiveMan Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //操作日志( WorkOperatingLog )  
    /// <summary>
    /// 操作日志
    /// </summary>
    public partial class Sql_WorkOperatingLog
    {
        #region 与数据表(操作日志)对应的字段属性
        /// <summary> 
        /// 主键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 时间 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 操作类型 
        /// </summary> 
        public System.String a_sOperatorType = null;
        /// <summary> 
        /// ID 
        /// </summary> 
        public System.Int32? a_ID = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidtBaseOperator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNametBaseOperator = null;
        /// <summary> 
        /// 操作对象 
        /// </summary> 
        public System.String a_sOperatorObject = null;
        /// <summary> 
        /// 描述标识 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 修改内容 
        /// </summary> 
        public System.String a_sValue = null;
        /// <summary> 
        /// IP地址 
        /// </summary> 
        public System.String a_sIP = null;
        /// <summary> 
        /// 网卡地址 
        /// </summary> 
        public System.String a_sMAC = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sOperatorType != null) { this.a_sOperatorType = ReplaceString.GetReplaceString(this.a_sOperatorType); }
            if (this.a_sGuidtBaseOperator != null) { this.a_sGuidtBaseOperator = ReplaceString.GetReplaceString(this.a_sGuidtBaseOperator); }
            if (this.a_sNametBaseOperator != null) { this.a_sNametBaseOperator = ReplaceString.GetReplaceString(this.a_sNametBaseOperator); }
            if (this.a_sOperatorObject != null) { this.a_sOperatorObject = ReplaceString.GetReplaceString(this.a_sOperatorObject); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sValue != null) { this.a_sValue = ReplaceString.GetReplaceString(this.a_sValue); }
            if (this.a_sIP != null) { this.a_sIP = ReplaceString.GetReplaceString(this.a_sIP); }
            if (this.a_sMAC != null) { this.a_sMAC = ReplaceString.GetReplaceString(this.a_sMAC); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkOperatingLog( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sOperatorType != null) { mySqlScript += "sOperatorType,"; }
            if (this.a_ID != null) { mySqlScript += "ID,"; }
            if (this.a_sGuidtBaseOperator != null) { mySqlScript += "sGuidtBaseOperator,"; }
            if (this.a_sNametBaseOperator != null) { mySqlScript += "sNametBaseOperator,"; }
            if (this.a_sOperatorObject != null) { mySqlScript += "sOperatorObject,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sValue != null) { mySqlScript += "sValue,"; }
            if (this.a_sIP != null) { mySqlScript += "sIP,"; }
            if (this.a_sMAC != null) { mySqlScript += "sMAC,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sOperatorType != null) { mySqlScript += "'" + this.a_sOperatorType + "',"; }
            if (this.a_ID != null) { mySqlScript += this.a_ID + ","; }
            if (this.a_sGuidtBaseOperator != null) { mySqlScript += "'" + this.a_sGuidtBaseOperator + "',"; }
            if (this.a_sNametBaseOperator != null) { mySqlScript += "'" + this.a_sNametBaseOperator + "',"; }
            if (this.a_sOperatorObject != null) { mySqlScript += "'" + this.a_sOperatorObject + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sValue != null) { mySqlScript += "'" + this.a_sValue + "',"; }
            if (this.a_sIP != null) { mySqlScript += "'" + this.a_sIP + "',"; }
            if (this.a_sMAC != null) { mySqlScript += "'" + this.a_sMAC + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkOperatingLog set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sOperatorType != null) { iColumnCount++; mySqlScript += " sOperatorType = '" + this.a_sOperatorType + "',"; }
            if (this.a_ID != null) { iColumnCount++; mySqlScript += " ID = " + this.a_ID + ","; }
            if (this.a_sGuidtBaseOperator != null) { iColumnCount++; mySqlScript += " sGuidtBaseOperator = '" + this.a_sGuidtBaseOperator + "',"; }
            if (this.a_sNametBaseOperator != null) { iColumnCount++; mySqlScript += " sNametBaseOperator = '" + this.a_sNametBaseOperator + "',"; }
            if (this.a_sOperatorObject != null) { iColumnCount++; mySqlScript += " sOperatorObject = '" + this.a_sOperatorObject + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sValue != null) { iColumnCount++; mySqlScript += " sValue = '" + this.a_sValue + "',"; }
            if (this.a_sIP != null) { iColumnCount++; mySqlScript += " sIP = '" + this.a_sIP + "',"; }
            if (this.a_sMAC != null) { iColumnCount++; mySqlScript += " sMAC = '" + this.a_sMAC + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkOperatingLog Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //订单( WorkOrder )  
    /// <summary>
    /// 订单
    /// </summary>
    public partial class Sql_WorkOrder
    {
        #region 与数据表(订单)对应的字段属性
        /// <summary> 
        /// 主键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 登记类型(正常/预约/补登) 
        /// </summary> 
        public System.String a_sRegisterType = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// Web订单ID 
        /// </summary> 
        public System.String a_sGuidWorkWeb_Order = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 客户 
        /// </summary> 
        public System.String a_sNameBaseCRM_Customer = null;
        /// <summary> 
        /// 代理公司ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer_Agent = null;
        /// <summary> 
        /// 代理公司 
        /// </summary> 
        public System.String a_sNameBaseCRM_Customer_Agent = null;
        /// <summary> 
        /// 代理人ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer_Deputy = null;
        /// <summary> 
        /// 代理人 
        /// </summary> 
        public System.String a_sNameBaseCRM_Customer_Deputy = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 地址 
        /// </summary> 
        public System.String a_sAddress = null;
        /// <summary> 
        /// 电话 
        /// </summary> 
        public System.String a_sPhone = null;
        /// <summary> 
        /// 联系人 
        /// </summary> 
        public System.String a_sContactMan = null;
        /// <summary> 
        /// 邮编 
        /// </summary> 
        public System.String a_sPostCode = null;
        /// <summary> 
        /// 经办人 
        /// </summary> 
        public System.String a_sResponsibleMan = null;
        /// <summary> 
        /// 发票号码 
        /// </summary> 
        public System.String a_sInvoiceNum = null;
        /// <summary> 
        /// 合同号码 
        /// </summary> 
        public System.String a_sContractNum = null;
        /// <summary> 
        /// 是否代理付款 
        /// </summary> 
        public System.Boolean? a_bAgentPay = null;
        /// <summary> 
        /// 业务类型ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_BusinessMode = null;
        /// <summary> 
        /// 业务类型 
        /// </summary> 
        public System.String a_sNameBaseOrder_BusinessMode = null;
        /// <summary> 
        /// 审批流程ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 审批流程 
        /// </summary> 
        public System.String a_sNameBaseApprovalProcess = null;
        /// <summary> 
        /// 审批状态(待审/在审/否决/通过/撤消) 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 登记日期 
        /// </summary> 
        public System.DateTime? a_dEntryDate = null;
        /// <summary> 
        /// 订单编号 
        /// </summary> 
        public System.Int32? a_iOrderNum = null;
        /// <summary> 
        /// 客户号 
        /// </summary> 
        public System.Int32? a_iCustomerNum = null;
        /// <summary> 
        /// 代理号 
        /// </summary> 
        public System.Int32? a_iAgentNum = null;
        /// <summary> 
        /// 对方订单编号 
        /// </summary> 
        public System.String a_sOrderNum_OppositeSide = null;
        /// <summary> 
        /// 主部门(业务) 
        /// </summary> 
        public System.String a_sNameBase_Department = null;
        /// <summary> 
        /// 主业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Employee = null;
        /// <summary> 
        /// 主业务员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Employee = null;
        /// <summary> 
        /// 主部门(公共) 
        /// </summary> 
        public System.String a_sNameBase_Department_PublicRelations = null;
        /// <summary> 
        /// 主公关人ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_PublicRelations = null;
        /// <summary> 
        /// 主公关人 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_PublicRelations = null;
        /// <summary> 
        /// 广告标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 地区1级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Source_1 = null;
        /// <summary> 
        /// 地区2级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Source_2 = null;
        /// <summary> 
        /// 地区3级ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Source_3 = null;
        /// <summary> 
        /// 地区1级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Source_1 = null;
        /// <summary> 
        /// 地区2级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Source_2 = null;
        /// <summary> 
        /// 地区3级 
        /// </summary> 
        public System.String a_sNameBaseOrder_Source_3 = null;
        /// <summary> 
        /// 承包人 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_ContractMan = null;
        /// <summary> 
        /// 中介人 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_IntermediaryMan = null;
        /// <summary> 
        /// 内容类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_ContentType = null;
        /// <summary> 
        /// 内容类别 
        /// </summary> 
        public System.String a_sNameBasePrice_ContentType = null;
        /// <summary> 
        /// 来稿方式ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_ArrivalManuscriptMode = null;
        /// <summary> 
        /// 来稿方式 
        /// </summary> 
        public System.String a_sNameBaseOrder_ArrivalManuscriptMode = null;
        /// <summary> 
        /// 长单类型ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_LongOrderType = null;
        /// <summary> 
        /// 长单类型 
        /// </summary> 
        public System.String a_sNameBaseOrder_LongOrderType = null;
        /// <summary> 
        /// 赠送政策ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Present = null;
        /// <summary> 
        /// 赠送政策 
        /// </summary> 
        public System.String a_sNameBaseOrder_Present = null;
        /// <summary> 
        /// 商业类型ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_BusinessType = null;
        /// <summary> 
        /// 商业类型 
        /// </summary> 
        public System.String a_sNameBaseOrder_BusinessType = null;
        /// <summary> 
        /// 审核领导 
        /// </summary> 
        public System.String a_sCheckLeader = null;
        /// <summary> 
        /// 次数限制 
        /// </summary> 
        public System.Int32? a_iLimit_Count = null;
        /// <summary> 
        /// 金额限制 
        /// </summary> 
        public System.Double? a_nLimit_Money = null;
        /// <summary> 
        /// 打印发稿单 
        /// </summary> 
        public System.Boolean? a_bPrinted = null;
        /// <summary> 
        /// 广告实际类型(面积/分类) 
        /// </summary> 
        public System.String a_sFlagAdvertisingType = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 行版本 
        /// </summary> 
        public System.String a_RowVersion = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sRegisterType != null) { this.a_sRegisterType = ReplaceString.GetReplaceString(this.a_sRegisterType); }
            if (this.a_sGuidWorkWeb_Order != null) { this.a_sGuidWorkWeb_Order = ReplaceString.GetReplaceString(this.a_sGuidWorkWeb_Order); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sNameBaseCRM_Customer != null) { this.a_sNameBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sNameBaseCRM_Customer); }
            if (this.a_sGuidBaseCRM_Customer_Agent != null) { this.a_sGuidBaseCRM_Customer_Agent = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer_Agent); }
            if (this.a_sNameBaseCRM_Customer_Agent != null) { this.a_sNameBaseCRM_Customer_Agent = ReplaceString.GetReplaceString(this.a_sNameBaseCRM_Customer_Agent); }
            if (this.a_sGuidBaseCRM_Customer_Deputy != null) { this.a_sGuidBaseCRM_Customer_Deputy = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer_Deputy); }
            if (this.a_sNameBaseCRM_Customer_Deputy != null) { this.a_sNameBaseCRM_Customer_Deputy = ReplaceString.GetReplaceString(this.a_sNameBaseCRM_Customer_Deputy); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sAddress != null) { this.a_sAddress = ReplaceString.GetReplaceString(this.a_sAddress); }
            if (this.a_sPhone != null) { this.a_sPhone = ReplaceString.GetReplaceString(this.a_sPhone); }
            if (this.a_sContactMan != null) { this.a_sContactMan = ReplaceString.GetReplaceString(this.a_sContactMan); }
            if (this.a_sPostCode != null) { this.a_sPostCode = ReplaceString.GetReplaceString(this.a_sPostCode); }
            if (this.a_sResponsibleMan != null) { this.a_sResponsibleMan = ReplaceString.GetReplaceString(this.a_sResponsibleMan); }
            if (this.a_sInvoiceNum != null) { this.a_sInvoiceNum = ReplaceString.GetReplaceString(this.a_sInvoiceNum); }
            if (this.a_sContractNum != null) { this.a_sContractNum = ReplaceString.GetReplaceString(this.a_sContractNum); }
            if (this.a_sGuidBaseOrder_BusinessMode != null) { this.a_sGuidBaseOrder_BusinessMode = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_BusinessMode); }
            if (this.a_sNameBaseOrder_BusinessMode != null) { this.a_sNameBaseOrder_BusinessMode = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_BusinessMode); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sNameBaseApprovalProcess != null) { this.a_sNameBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sNameBaseApprovalProcess); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sOrderNum_OppositeSide != null) { this.a_sOrderNum_OppositeSide = ReplaceString.GetReplaceString(this.a_sOrderNum_OppositeSide); }
            if (this.a_sNameBase_Department != null) { this.a_sNameBase_Department = ReplaceString.GetReplaceString(this.a_sNameBase_Department); }
            if (this.a_sGuidBase_Department_Person_Employee != null) { this.a_sGuidBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Employee); }
            if (this.a_sNameBase_Department_Person_Employee != null) { this.a_sNameBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Employee); }
            if (this.a_sNameBase_Department_PublicRelations != null) { this.a_sNameBase_Department_PublicRelations = ReplaceString.GetReplaceString(this.a_sNameBase_Department_PublicRelations); }
            if (this.a_sGuidBase_Department_Person_PublicRelations != null) { this.a_sGuidBase_Department_Person_PublicRelations = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_PublicRelations); }
            if (this.a_sNameBase_Department_Person_PublicRelations != null) { this.a_sNameBase_Department_Person_PublicRelations = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_PublicRelations); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sGuidBaseOrder_Source_1 != null) { this.a_sGuidBaseOrder_Source_1 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Source_1); }
            if (this.a_sGuidBaseOrder_Source_2 != null) { this.a_sGuidBaseOrder_Source_2 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Source_2); }
            if (this.a_sGuidBaseOrder_Source_3 != null) { this.a_sGuidBaseOrder_Source_3 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Source_3); }
            if (this.a_sNameBaseOrder_Source_1 != null) { this.a_sNameBaseOrder_Source_1 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Source_1); }
            if (this.a_sNameBaseOrder_Source_2 != null) { this.a_sNameBaseOrder_Source_2 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Source_2); }
            if (this.a_sNameBaseOrder_Source_3 != null) { this.a_sNameBaseOrder_Source_3 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Source_3); }
            if (this.a_sNameBase_Department_Person_ContractMan != null) { this.a_sNameBase_Department_Person_ContractMan = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_ContractMan); }
            if (this.a_sNameBase_Department_Person_IntermediaryMan != null) { this.a_sNameBase_Department_Person_IntermediaryMan = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_IntermediaryMan); }
            if (this.a_sGuidBasePrice_ContentType != null) { this.a_sGuidBasePrice_ContentType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_ContentType); }
            if (this.a_sNameBasePrice_ContentType != null) { this.a_sNameBasePrice_ContentType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_ContentType); }
            if (this.a_sGuidBaseOrder_ArrivalManuscriptMode != null) { this.a_sGuidBaseOrder_ArrivalManuscriptMode = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_ArrivalManuscriptMode); }
            if (this.a_sNameBaseOrder_ArrivalManuscriptMode != null) { this.a_sNameBaseOrder_ArrivalManuscriptMode = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_ArrivalManuscriptMode); }
            if (this.a_sGuidBaseOrder_LongOrderType != null) { this.a_sGuidBaseOrder_LongOrderType = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_LongOrderType); }
            if (this.a_sNameBaseOrder_LongOrderType != null) { this.a_sNameBaseOrder_LongOrderType = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_LongOrderType); }
            if (this.a_sGuidBaseOrder_Present != null) { this.a_sGuidBaseOrder_Present = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Present); }
            if (this.a_sNameBaseOrder_Present != null) { this.a_sNameBaseOrder_Present = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Present); }
            if (this.a_sGuidBaseOrder_BusinessType != null) { this.a_sGuidBaseOrder_BusinessType = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_BusinessType); }
            if (this.a_sNameBaseOrder_BusinessType != null) { this.a_sNameBaseOrder_BusinessType = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_BusinessType); }
            if (this.a_sCheckLeader != null) { this.a_sCheckLeader = ReplaceString.GetReplaceString(this.a_sCheckLeader); }
            if (this.a_sFlagAdvertisingType != null) { this.a_sFlagAdvertisingType = ReplaceString.GetReplaceString(this.a_sFlagAdvertisingType); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkOrder( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sRegisterType != null) { mySqlScript += "sRegisterType,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkWeb_Order != null) { mySqlScript += "sGuidWorkWeb_Order,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_sNameBaseCRM_Customer != null) { mySqlScript += "sNameBaseCRM_Customer,"; }
            if (this.a_sGuidBaseCRM_Customer_Agent != null) { mySqlScript += "sGuidBaseCRM_Customer_Agent,"; }
            if (this.a_sNameBaseCRM_Customer_Agent != null) { mySqlScript += "sNameBaseCRM_Customer_Agent,"; }
            if (this.a_sGuidBaseCRM_Customer_Deputy != null) { mySqlScript += "sGuidBaseCRM_Customer_Deputy,"; }
            if (this.a_sNameBaseCRM_Customer_Deputy != null) { mySqlScript += "sNameBaseCRM_Customer_Deputy,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sAddress != null) { mySqlScript += "sAddress,"; }
            if (this.a_sPhone != null) { mySqlScript += "sPhone,"; }
            if (this.a_sContactMan != null) { mySqlScript += "sContactMan,"; }
            if (this.a_sPostCode != null) { mySqlScript += "sPostCode,"; }
            if (this.a_sResponsibleMan != null) { mySqlScript += "sResponsibleMan,"; }
            if (this.a_sInvoiceNum != null) { mySqlScript += "sInvoiceNum,"; }
            if (this.a_sContractNum != null) { mySqlScript += "sContractNum,"; }
            if (this.a_bAgentPay != null) { mySqlScript += "bAgentPay,"; }
            if (this.a_sGuidBaseOrder_BusinessMode != null) { mySqlScript += "sGuidBaseOrder_BusinessMode,"; }
            if (this.a_sNameBaseOrder_BusinessMode != null) { mySqlScript += "sNameBaseOrder_BusinessMode,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_sNameBaseApprovalProcess != null) { mySqlScript += "sNameBaseApprovalProcess,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_dEntryDate != null) { mySqlScript += "dEntryDate,"; }
            if (this.a_iOrderNum != null) { mySqlScript += "iOrderNum,"; }
            if (this.a_iCustomerNum != null) { mySqlScript += "iCustomerNum,"; }
            if (this.a_iAgentNum != null) { mySqlScript += "iAgentNum,"; }
            if (this.a_sOrderNum_OppositeSide != null) { mySqlScript += "sOrderNum_OppositeSide,"; }
            if (this.a_sNameBase_Department != null) { mySqlScript += "sNameBase_Department,"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "sGuidBase_Department_Person_Employee,"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "sNameBase_Department_Person_Employee,"; }
            if (this.a_sNameBase_Department_PublicRelations != null) { mySqlScript += "sNameBase_Department_PublicRelations,"; }
            if (this.a_sGuidBase_Department_Person_PublicRelations != null) { mySqlScript += "sGuidBase_Department_Person_PublicRelations,"; }
            if (this.a_sNameBase_Department_Person_PublicRelations != null) { mySqlScript += "sNameBase_Department_Person_PublicRelations,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sGuidBaseOrder_Source_1 != null) { mySqlScript += "sGuidBaseOrder_Source_1,"; }
            if (this.a_sGuidBaseOrder_Source_2 != null) { mySqlScript += "sGuidBaseOrder_Source_2,"; }
            if (this.a_sGuidBaseOrder_Source_3 != null) { mySqlScript += "sGuidBaseOrder_Source_3,"; }
            if (this.a_sNameBaseOrder_Source_1 != null) { mySqlScript += "sNameBaseOrder_Source_1,"; }
            if (this.a_sNameBaseOrder_Source_2 != null) { mySqlScript += "sNameBaseOrder_Source_2,"; }
            if (this.a_sNameBaseOrder_Source_3 != null) { mySqlScript += "sNameBaseOrder_Source_3,"; }
            if (this.a_sNameBase_Department_Person_ContractMan != null) { mySqlScript += "sNameBase_Department_Person_ContractMan,"; }
            if (this.a_sNameBase_Department_Person_IntermediaryMan != null) { mySqlScript += "sNameBase_Department_Person_IntermediaryMan,"; }
            if (this.a_sGuidBasePrice_ContentType != null) { mySqlScript += "sGuidBasePrice_ContentType,"; }
            if (this.a_sNameBasePrice_ContentType != null) { mySqlScript += "sNameBasePrice_ContentType,"; }
            if (this.a_sGuidBaseOrder_ArrivalManuscriptMode != null) { mySqlScript += "sGuidBaseOrder_ArrivalManuscriptMode,"; }
            if (this.a_sNameBaseOrder_ArrivalManuscriptMode != null) { mySqlScript += "sNameBaseOrder_ArrivalManuscriptMode,"; }
            if (this.a_sGuidBaseOrder_LongOrderType != null) { mySqlScript += "sGuidBaseOrder_LongOrderType,"; }
            if (this.a_sNameBaseOrder_LongOrderType != null) { mySqlScript += "sNameBaseOrder_LongOrderType,"; }
            if (this.a_sGuidBaseOrder_Present != null) { mySqlScript += "sGuidBaseOrder_Present,"; }
            if (this.a_sNameBaseOrder_Present != null) { mySqlScript += "sNameBaseOrder_Present,"; }
            if (this.a_sGuidBaseOrder_BusinessType != null) { mySqlScript += "sGuidBaseOrder_BusinessType,"; }
            if (this.a_sNameBaseOrder_BusinessType != null) { mySqlScript += "sNameBaseOrder_BusinessType,"; }
            if (this.a_sCheckLeader != null) { mySqlScript += "sCheckLeader,"; }
            if (this.a_iLimit_Count != null) { mySqlScript += "iLimit_Count,"; }
            if (this.a_nLimit_Money != null) { mySqlScript += "nLimit_Money,"; }
            if (this.a_bPrinted != null) { mySqlScript += "bPrinted,"; }
            if (this.a_sFlagAdvertisingType != null) { mySqlScript += "sFlagAdvertisingType,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_RowVersion != null) { mySqlScript += "RowVersion,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sRegisterType != null) { mySqlScript += "'" + this.a_sRegisterType + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkWeb_Order != null) { mySqlScript += "'" + this.a_sGuidWorkWeb_Order + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sNameBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sNameBaseCRM_Customer + "',"; }
            if (this.a_sGuidBaseCRM_Customer_Agent != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer_Agent + "',"; }
            if (this.a_sNameBaseCRM_Customer_Agent != null) { mySqlScript += "'" + this.a_sNameBaseCRM_Customer_Agent + "',"; }
            if (this.a_sGuidBaseCRM_Customer_Deputy != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer_Deputy + "',"; }
            if (this.a_sNameBaseCRM_Customer_Deputy != null) { mySqlScript += "'" + this.a_sNameBaseCRM_Customer_Deputy + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sAddress != null) { mySqlScript += "'" + this.a_sAddress + "',"; }
            if (this.a_sPhone != null) { mySqlScript += "'" + this.a_sPhone + "',"; }
            if (this.a_sContactMan != null) { mySqlScript += "'" + this.a_sContactMan + "',"; }
            if (this.a_sPostCode != null) { mySqlScript += "'" + this.a_sPostCode + "',"; }
            if (this.a_sResponsibleMan != null) { mySqlScript += "'" + this.a_sResponsibleMan + "',"; }
            if (this.a_sInvoiceNum != null) { mySqlScript += "'" + this.a_sInvoiceNum + "',"; }
            if (this.a_sContractNum != null) { mySqlScript += "'" + this.a_sContractNum + "',"; }
            if (this.a_bAgentPay != null) { mySqlScript += "'" + this.a_bAgentPay + "',"; }
            if (this.a_sGuidBaseOrder_BusinessMode != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_BusinessMode + "',"; }
            if (this.a_sNameBaseOrder_BusinessMode != null) { mySqlScript += "'" + this.a_sNameBaseOrder_BusinessMode + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sNameBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sNameBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_dEntryDate != null) { mySqlScript += "'" + this.a_dEntryDate + "',"; }
            if (this.a_iOrderNum != null) { mySqlScript += this.a_iOrderNum + ","; }
            if (this.a_iCustomerNum != null) { mySqlScript += this.a_iCustomerNum + ","; }
            if (this.a_iAgentNum != null) { mySqlScript += this.a_iAgentNum + ","; }
            if (this.a_sOrderNum_OppositeSide != null) { mySqlScript += "'" + this.a_sOrderNum_OppositeSide + "',"; }
            if (this.a_sNameBase_Department != null) { mySqlScript += "'" + this.a_sNameBase_Department + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_sNameBase_Department_PublicRelations != null) { mySqlScript += "'" + this.a_sNameBase_Department_PublicRelations + "',"; }
            if (this.a_sGuidBase_Department_Person_PublicRelations != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_PublicRelations + "',"; }
            if (this.a_sNameBase_Department_Person_PublicRelations != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_PublicRelations + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseOrder_Source_1 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Source_1 + "',"; }
            if (this.a_sGuidBaseOrder_Source_2 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Source_2 + "',"; }
            if (this.a_sGuidBaseOrder_Source_3 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Source_3 + "',"; }
            if (this.a_sNameBaseOrder_Source_1 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Source_1 + "',"; }
            if (this.a_sNameBaseOrder_Source_2 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Source_2 + "',"; }
            if (this.a_sNameBaseOrder_Source_3 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Source_3 + "',"; }
            if (this.a_sNameBase_Department_Person_ContractMan != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_ContractMan + "',"; }
            if (this.a_sNameBase_Department_Person_IntermediaryMan != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_IntermediaryMan + "',"; }
            if (this.a_sGuidBasePrice_ContentType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_ContentType + "',"; }
            if (this.a_sNameBasePrice_ContentType != null) { mySqlScript += "'" + this.a_sNameBasePrice_ContentType + "',"; }
            if (this.a_sGuidBaseOrder_ArrivalManuscriptMode != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_ArrivalManuscriptMode + "',"; }
            if (this.a_sNameBaseOrder_ArrivalManuscriptMode != null) { mySqlScript += "'" + this.a_sNameBaseOrder_ArrivalManuscriptMode + "',"; }
            if (this.a_sGuidBaseOrder_LongOrderType != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_LongOrderType + "',"; }
            if (this.a_sNameBaseOrder_LongOrderType != null) { mySqlScript += "'" + this.a_sNameBaseOrder_LongOrderType + "',"; }
            if (this.a_sGuidBaseOrder_Present != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Present + "',"; }
            if (this.a_sNameBaseOrder_Present != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Present + "',"; }
            if (this.a_sGuidBaseOrder_BusinessType != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_BusinessType + "',"; }
            if (this.a_sNameBaseOrder_BusinessType != null) { mySqlScript += "'" + this.a_sNameBaseOrder_BusinessType + "',"; }
            if (this.a_sCheckLeader != null) { mySqlScript += "'" + this.a_sCheckLeader + "',"; }
            if (this.a_iLimit_Count != null) { mySqlScript += this.a_iLimit_Count + ","; }
            if (this.a_nLimit_Money != null) { mySqlScript += this.a_nLimit_Money + ","; }
            if (this.a_bPrinted != null) { mySqlScript += "'" + this.a_bPrinted + "',"; }
            if (this.a_sFlagAdvertisingType != null) { mySqlScript += "'" + this.a_sFlagAdvertisingType + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_RowVersion != null) { mySqlScript += "'" + this.a_RowVersion + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkOrder set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sRegisterType != null) { iColumnCount++; mySqlScript += " sRegisterType = '" + this.a_sRegisterType + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkWeb_Order != null) { iColumnCount++; mySqlScript += " sGuidWorkWeb_Order = '" + this.a_sGuidWorkWeb_Order + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sNameBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sNameBaseCRM_Customer = '" + this.a_sNameBaseCRM_Customer + "',"; }
            if (this.a_sGuidBaseCRM_Customer_Agent != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer_Agent = '" + this.a_sGuidBaseCRM_Customer_Agent + "',"; }
            if (this.a_sNameBaseCRM_Customer_Agent != null) { iColumnCount++; mySqlScript += " sNameBaseCRM_Customer_Agent = '" + this.a_sNameBaseCRM_Customer_Agent + "',"; }
            if (this.a_sGuidBaseCRM_Customer_Deputy != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer_Deputy = '" + this.a_sGuidBaseCRM_Customer_Deputy + "',"; }
            if (this.a_sNameBaseCRM_Customer_Deputy != null) { iColumnCount++; mySqlScript += " sNameBaseCRM_Customer_Deputy = '" + this.a_sNameBaseCRM_Customer_Deputy + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sAddress != null) { iColumnCount++; mySqlScript += " sAddress = '" + this.a_sAddress + "',"; }
            if (this.a_sPhone != null) { iColumnCount++; mySqlScript += " sPhone = '" + this.a_sPhone + "',"; }
            if (this.a_sContactMan != null) { iColumnCount++; mySqlScript += " sContactMan = '" + this.a_sContactMan + "',"; }
            if (this.a_sPostCode != null) { iColumnCount++; mySqlScript += " sPostCode = '" + this.a_sPostCode + "',"; }
            if (this.a_sResponsibleMan != null) { iColumnCount++; mySqlScript += " sResponsibleMan = '" + this.a_sResponsibleMan + "',"; }
            if (this.a_sInvoiceNum != null) { iColumnCount++; mySqlScript += " sInvoiceNum = '" + this.a_sInvoiceNum + "',"; }
            if (this.a_sContractNum != null) { iColumnCount++; mySqlScript += " sContractNum = '" + this.a_sContractNum + "',"; }
            if (this.a_bAgentPay != null) { iColumnCount++; mySqlScript += " bAgentPay = '" + this.a_bAgentPay + "',"; }
            if (this.a_sGuidBaseOrder_BusinessMode != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_BusinessMode = '" + this.a_sGuidBaseOrder_BusinessMode + "',"; }
            if (this.a_sNameBaseOrder_BusinessMode != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_BusinessMode = '" + this.a_sNameBaseOrder_BusinessMode + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sNameBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sNameBaseApprovalProcess = '" + this.a_sNameBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_dEntryDate != null) { iColumnCount++; mySqlScript += " dEntryDate = '" + this.a_dEntryDate + "',"; }
            if (this.a_iOrderNum != null) { iColumnCount++; mySqlScript += " iOrderNum = " + this.a_iOrderNum + ","; }
            if (this.a_iCustomerNum != null) { iColumnCount++; mySqlScript += " iCustomerNum = " + this.a_iCustomerNum + ","; }
            if (this.a_iAgentNum != null) { iColumnCount++; mySqlScript += " iAgentNum = " + this.a_iAgentNum + ","; }
            if (this.a_sOrderNum_OppositeSide != null) { iColumnCount++; mySqlScript += " sOrderNum_OppositeSide = '" + this.a_sOrderNum_OppositeSide + "',"; }
            if (this.a_sNameBase_Department != null) { iColumnCount++; mySqlScript += " sNameBase_Department = '" + this.a_sNameBase_Department + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Employee = '" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Employee = '" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_sNameBase_Department_PublicRelations != null) { iColumnCount++; mySqlScript += " sNameBase_Department_PublicRelations = '" + this.a_sNameBase_Department_PublicRelations + "',"; }
            if (this.a_sGuidBase_Department_Person_PublicRelations != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_PublicRelations = '" + this.a_sGuidBase_Department_Person_PublicRelations + "',"; }
            if (this.a_sNameBase_Department_Person_PublicRelations != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_PublicRelations = '" + this.a_sNameBase_Department_Person_PublicRelations + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseOrder_Source_1 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Source_1 = '" + this.a_sGuidBaseOrder_Source_1 + "',"; }
            if (this.a_sGuidBaseOrder_Source_2 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Source_2 = '" + this.a_sGuidBaseOrder_Source_2 + "',"; }
            if (this.a_sGuidBaseOrder_Source_3 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Source_3 = '" + this.a_sGuidBaseOrder_Source_3 + "',"; }
            if (this.a_sNameBaseOrder_Source_1 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Source_1 = '" + this.a_sNameBaseOrder_Source_1 + "',"; }
            if (this.a_sNameBaseOrder_Source_2 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Source_2 = '" + this.a_sNameBaseOrder_Source_2 + "',"; }
            if (this.a_sNameBaseOrder_Source_3 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Source_3 = '" + this.a_sNameBaseOrder_Source_3 + "',"; }
            if (this.a_sNameBase_Department_Person_ContractMan != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_ContractMan = '" + this.a_sNameBase_Department_Person_ContractMan + "',"; }
            if (this.a_sNameBase_Department_Person_IntermediaryMan != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_IntermediaryMan = '" + this.a_sNameBase_Department_Person_IntermediaryMan + "',"; }
            if (this.a_sGuidBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_ContentType = '" + this.a_sGuidBasePrice_ContentType + "',"; }
            if (this.a_sNameBasePrice_ContentType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_ContentType = '" + this.a_sNameBasePrice_ContentType + "',"; }
            if (this.a_sGuidBaseOrder_ArrivalManuscriptMode != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_ArrivalManuscriptMode = '" + this.a_sGuidBaseOrder_ArrivalManuscriptMode + "',"; }
            if (this.a_sNameBaseOrder_ArrivalManuscriptMode != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_ArrivalManuscriptMode = '" + this.a_sNameBaseOrder_ArrivalManuscriptMode + "',"; }
            if (this.a_sGuidBaseOrder_LongOrderType != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_LongOrderType = '" + this.a_sGuidBaseOrder_LongOrderType + "',"; }
            if (this.a_sNameBaseOrder_LongOrderType != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_LongOrderType = '" + this.a_sNameBaseOrder_LongOrderType + "',"; }
            if (this.a_sGuidBaseOrder_Present != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Present = '" + this.a_sGuidBaseOrder_Present + "',"; }
            if (this.a_sNameBaseOrder_Present != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Present = '" + this.a_sNameBaseOrder_Present + "',"; }
            if (this.a_sGuidBaseOrder_BusinessType != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_BusinessType = '" + this.a_sGuidBaseOrder_BusinessType + "',"; }
            if (this.a_sNameBaseOrder_BusinessType != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_BusinessType = '" + this.a_sNameBaseOrder_BusinessType + "',"; }
            if (this.a_sCheckLeader != null) { iColumnCount++; mySqlScript += " sCheckLeader = '" + this.a_sCheckLeader + "',"; }
            if (this.a_iLimit_Count != null) { iColumnCount++; mySqlScript += " iLimit_Count = " + this.a_iLimit_Count + ","; }
            if (this.a_nLimit_Money != null) { iColumnCount++; mySqlScript += " nLimit_Money = " + this.a_nLimit_Money + ","; }
            if (this.a_bPrinted != null) { iColumnCount++; mySqlScript += " bPrinted = '" + this.a_bPrinted + "',"; }
            if (this.a_sFlagAdvertisingType != null) { iColumnCount++; mySqlScript += " sFlagAdvertisingType = '" + this.a_sFlagAdvertisingType + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_RowVersion != null) { iColumnCount++; mySqlScript += " RowVersion = '" + this.a_RowVersion + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkOrder Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //广告( WorkOrderItem )  
    /// <summary>
    /// 广告
    /// </summary>
    public partial class Sql_WorkOrderItem
    {
        #region 与数据表(广告)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 关联订单表 
        /// </summary> 
        public System.String a_sGuidWorkOrder = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 加刊 
        /// </summary> 
        public System.Boolean? a_bFlagAdd = null;
        /// <summary> 
        /// 改刊 
        /// </summary> 
        public System.Boolean? a_bFlagChange = null;
        /// <summary> 
        /// 停刊 
        /// </summary> 
        public System.Boolean? a_bFlagStop = null;
        /// <summary> 
        /// 广告类型ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_AdvertisingType = null;
        /// <summary> 
        /// 广告类型 
        /// </summary> 
        public System.String a_sNameBaseOrder_AdvertisingType = null;
        /// <summary> 
        /// 媒体ID 
        /// </summary> 
        public System.String a_sGuidBaseMedia = null;
        /// <summary> 
        /// 媒体 
        /// </summary> 
        public System.String a_sNameBaseMedia = null;
        /// <summary> 
        /// 版位类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 版位类别 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 行业1ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_1 = null;
        /// <summary> 
        /// 行业2ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_2 = null;
        /// <summary> 
        /// 行业3ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Industry_3 = null;
        /// <summary> 
        /// 行业1 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_1 = null;
        /// <summary> 
        /// 行业2 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_2 = null;
        /// <summary> 
        /// 行业3 
        /// </summary> 
        public System.String a_sNameBaseOrder_Industry_3 = null;
        /// <summary> 
        /// 规格ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_Specification = null;
        /// <summary> 
        /// 规格 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_Specification = null;
        /// <summary> 
        /// 付款类型ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_PaymentType = null;
        /// <summary> 
        /// 付款类型 
        /// </summary> 
        public System.String a_sNameBaseOrder_PaymentType = null;
        /// <summary> 
        /// 价格表ID 
        /// </summary> 
        public System.String a_sGuidBaseMedia_PriceTable = null;
        /// <summary> 
        /// 价格表 
        /// </summary> 
        public System.String a_sNameBaseMedia_PriceTable = null;
        /// <summary> 
        /// 色彩ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Color = null;
        /// <summary> 
        /// 色彩 
        /// </summary> 
        public System.String a_sNameBasePrice_Color = null;
        /// <summary> 
        /// 品牌ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer_Brand = null;
        /// <summary> 
        /// 品牌 
        /// </summary> 
        public System.String a_sNameBaseCRM_Customer_Brand = null;
        /// <summary> 
        /// 佣金复核 
        /// </summary> 
        public System.Boolean? a_bCommissionReview = null;
        /// <summary> 
        /// 佣金复核人 
        /// </summary> 
        public System.String a_sCommissionReviewMan = null;
        /// <summary> 
        /// 佣金复核时间 
        /// </summary> 
        public System.DateTime? a_dCommissionReviewDate = null;
        /// <summary> 
        /// 图片文件路径和名称 
        /// </summary> 
        public System.String a_s_pic_path_file = null;
        /// <summary> 
        /// 正文计价规则 
        /// </summary> 
        public System.String a_s_Categories_ValuationRules_Text = null;
        /// <summary> 
        /// 标题计价规则 
        /// </summary> 
        public System.String a_s_Categories_ValuationRules_Title = null;
        /// <summary> 
        /// 分类排版属性(边框 底纹 加大加黑) 
        /// </summary> 
        public System.String a_s_Categories_xml = null;
        /// <summary> 
        /// 分类排版属性(说明) 
        /// </summary> 
        public System.String a_s_Categories_xml_Remark = null;
        /// <summary> 
        /// 正文计价数量 
        /// </summary> 
        public System.Double? a_n_Categories_Count_Text = null;
        /// <summary> 
        /// 标题计价数量 
        /// </summary> 
        public System.Double? a_n_Categories_Count_Title = null;
        /// <summary> 
        /// 标题单价 
        /// </summary> 
        public System.Double? a_n_Categories_Price_Title = null;
        /// <summary> 
        /// 正文单价 
        /// </summary> 
        public System.Double? a_n_Categories_Price_Text = null;
        /// <summary> 
        /// 欠款审批标志 
        /// </summary> 
        public System.Boolean? a_bApproval_Arrears = null;
        /// <summary> 
        /// 欠款审批人 
        /// </summary> 
        public System.String a_sApproval_Arrears_Man = null;
        /// <summary> 
        /// 欠款审批时间 
        /// </summary> 
        public System.DateTime? a_dApproval_Arrears_Date = null;
        /// <summary> 
        /// 广告内容 
        /// </summary> 
        public System.String a_sContent = null;
        /// <summary> 
        /// 预约版位ID 
        /// </summary> 
        public System.String a_s_Preordain_GuidBaseMedia_Fold_Page = null;
        /// <summary> 
        /// 预约叠次 
        /// </summary> 
        public System.String a_s_Preordain_NameBaseMedia_Fold_Page_Fold = null;
        /// <summary> 
        /// 预约版面 
        /// </summary> 
        public System.String a_s_Preordain_NameBaseMedia_Fold_Page_FoldPage = null;
        /// <summary> 
        /// 预订日期 
        /// </summary> 
        public System.DateTime? a_d_Preordain_Date = null;
        /// <summary> 
        /// 见报版位ID 
        /// </summary> 
        public System.String a_s_Publish_GuidBaseMedia_Fold_Page = null;
        /// <summary> 
        /// 见报叠次 
        /// </summary> 
        public System.String a_s_Publish_NameBaseMedia_Fold_Page_Fold = null;
        /// <summary> 
        /// 见报版面 
        /// </summary> 
        public System.String a_s_Publish_NameBaseMedia_Fold_Page_FoldPage = null;
        /// <summary> 
        /// 见报日期 
        /// </summary> 
        public System.DateTime? a_d_Publish_Date = null;
        /// <summary> 
        /// 见报操作员 
        /// </summary> 
        public System.String a_s_Publish_NameOperator = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 超捷路径 
        /// </summary> 
        public System.String a_s_cj_Path = null;
        /// <summary> 
        /// 超捷文件名 
        /// </summary> 
        public System.String a_s_cj_filename = null;
        /// <summary> 
        /// 超捷用xml 
        /// </summary> 
        public System.String a_s_cj_xml = null;
        /// <summary> 
        /// 划版标志 
        /// </summary> 
        public System.Boolean? a_b_HB = null;
        /// <summary> 
        /// 锁定 
        /// </summary> 
        public System.Boolean? a_b_HB_Lock = null;
        /// <summary> 
        /// 划版位置X 
        /// </summary> 
        public System.Double? a_n_HB_X = null;
        /// <summary> 
        /// 划版位置Y 
        /// </summary> 
        public System.Double? a_n_HB_Y = null;
        /// <summary> 
        /// 划版日期 
        /// </summary> 
        public System.DateTime? a_d_HB_Date = null;
        /// <summary> 
        /// 划版人 
        /// </summary> 
        public System.String a_sHB_Operator = null;
        /// <summary> 
        /// 排版状态 
        /// </summary> 
        public System.String a_sArrangePageStatus = null;
        /// <summary> 
        /// 加价率 
        /// </summary> 
        public System.Double? a_nIncreaseProportion = null;
        /// <summary> 
        /// 标准价格 
        /// </summary> 
        public System.Double? a_n_Price_Standard = null;
        /// <summary> 
        /// 签订金额 
        /// </summary> 
        public System.Double? a_n_Price_Signed = null;
        /// <summary> 
        /// 附加费 
        /// </summary> 
        public System.Double? a_nFee_Additional = null;
        /// <summary> 
        /// 制版费 
        /// </summary> 
        public System.Double? a_nFee_MakePage = null;
        /// <summary> 
        /// 平帐金额 
        /// </summary> 
        public System.Double? a_n_Money_ClearArrears = null;
        /// <summary> 
        /// 折扣 
        /// </summary> 
        public System.Double? a_n_Discount = null;
        /// <summary> 
        /// 责编姓名 
        /// </summary> 
        public System.String a_s_NameEditor = null;
        /// <summary> 
        /// 期数 
        /// </summary> 
        public System.Int32? a_iIssueNum_Current = null;
        /// <summary> 
        /// 总期数 
        /// </summary> 
        public System.Int32? a_iIssueNum_Total = null;
        /// <summary> 
        /// 组稿费计算次数 
        /// </summary> 
        public System.Int32? a_i_Reward_CalculateCount = null;
        /// <summary> 
        /// 是否计算客户返回金 
        /// </summary> 
        public System.Boolean? a_bCustomerReturnMoney = null;
        /// <summary> 
        /// 广告项目ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_Project = null;
        /// <summary> 
        /// 广告项目 
        /// </summary> 
        public System.String a_sNameBaseOrder_Project = null;
        /// <summary> 
        /// 版位一级ID(日报用的) 
        /// </summary> 
        public System.String a_sGuidBaseOrder_PagePosition_1 = null;
        /// <summary> 
        /// 版位一级(日报用的) 
        /// </summary> 
        public System.String a_sNameBaseOrder_PagePosition_1 = null;
        /// <summary> 
        /// 版位2级ID(日报用的) 
        /// </summary> 
        public System.String a_sGuidBaseOrder_PagePosition_2 = null;
        /// <summary> 
        /// 版位2级(日报用的) 
        /// </summary> 
        public System.String a_sNameBaseOrder_PagePosition_2 = null;
        /// <summary> 
        /// 版位3级ID(日报用的) 
        /// </summary> 
        public System.String a_sGuidBaseOrder_PagePosition_3 = null;
        /// <summary> 
        /// 版位3级(日报用的) 
        /// </summary> 
        public System.String a_sNameBaseOrder_PagePosition_3 = null;
        /// <summary> 
        /// 赠送标志 
        /// </summary> 
        public System.Boolean? a_bPresent = null;
        /// <summary> 
        /// 翻转标志 
        /// </summary> 
        public System.Boolean? a_bReverse = null;
        /// <summary> 
        /// 宽度(厘米) 
        /// </summary> 
        public System.Double? a_nWidth = null;
        /// <summary> 
        /// 高度(厘米) 
        /// </summary> 
        public System.Double? a_nHeight = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 行版本 
        /// </summary> 
        public System.String a_RowVersion = null;
        /// <summary> 
        /// 有效 
        /// </summary> 
        public System.Boolean? a_bValid = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkOrder != null) { this.a_sGuidWorkOrder = ReplaceString.GetReplaceString(this.a_sGuidWorkOrder); }
            if (this.a_sGuidBaseOrder_AdvertisingType != null) { this.a_sGuidBaseOrder_AdvertisingType = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_AdvertisingType); }
            if (this.a_sNameBaseOrder_AdvertisingType != null) { this.a_sNameBaseOrder_AdvertisingType = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_AdvertisingType); }
            if (this.a_sGuidBaseMedia != null) { this.a_sGuidBaseMedia = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia); }
            if (this.a_sNameBaseMedia != null) { this.a_sNameBaseMedia = ReplaceString.GetReplaceString(this.a_sNameBaseMedia); }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { this.a_sGuidBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_PagePositionType); }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { this.a_sNameBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_PagePositionType); }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { this.a_sGuidBaseOrder_Industry_1 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_1); }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { this.a_sGuidBaseOrder_Industry_2 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_2); }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { this.a_sGuidBaseOrder_Industry_3 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Industry_3); }
            if (this.a_sNameBaseOrder_Industry_1 != null) { this.a_sNameBaseOrder_Industry_1 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_1); }
            if (this.a_sNameBaseOrder_Industry_2 != null) { this.a_sNameBaseOrder_Industry_2 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_2); }
            if (this.a_sNameBaseOrder_Industry_3 != null) { this.a_sNameBaseOrder_Industry_3 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Industry_3); }
            if (this.a_sGuidBasePrice_Media_Specification != null) { this.a_sGuidBasePrice_Media_Specification = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_Specification); }
            if (this.a_sNameBasePrice_Media_Specification != null) { this.a_sNameBasePrice_Media_Specification = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_Specification); }
            if (this.a_sGuidBaseOrder_PaymentType != null) { this.a_sGuidBaseOrder_PaymentType = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_PaymentType); }
            if (this.a_sNameBaseOrder_PaymentType != null) { this.a_sNameBaseOrder_PaymentType = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_PaymentType); }
            if (this.a_sGuidBaseMedia_PriceTable != null) { this.a_sGuidBaseMedia_PriceTable = ReplaceString.GetReplaceString(this.a_sGuidBaseMedia_PriceTable); }
            if (this.a_sNameBaseMedia_PriceTable != null) { this.a_sNameBaseMedia_PriceTable = ReplaceString.GetReplaceString(this.a_sNameBaseMedia_PriceTable); }
            if (this.a_sGuidBasePrice_Color != null) { this.a_sGuidBasePrice_Color = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Color); }
            if (this.a_sNameBasePrice_Color != null) { this.a_sNameBasePrice_Color = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Color); }
            if (this.a_sGuidBaseCRM_Customer_Brand != null) { this.a_sGuidBaseCRM_Customer_Brand = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer_Brand); }
            if (this.a_sNameBaseCRM_Customer_Brand != null) { this.a_sNameBaseCRM_Customer_Brand = ReplaceString.GetReplaceString(this.a_sNameBaseCRM_Customer_Brand); }
            if (this.a_sCommissionReviewMan != null) { this.a_sCommissionReviewMan = ReplaceString.GetReplaceString(this.a_sCommissionReviewMan); }
            if (this.a_s_pic_path_file != null) { this.a_s_pic_path_file = ReplaceString.GetReplaceString(this.a_s_pic_path_file); }
            if (this.a_s_Categories_ValuationRules_Text != null) { this.a_s_Categories_ValuationRules_Text = ReplaceString.GetReplaceString(this.a_s_Categories_ValuationRules_Text); }
            if (this.a_s_Categories_ValuationRules_Title != null) { this.a_s_Categories_ValuationRules_Title = ReplaceString.GetReplaceString(this.a_s_Categories_ValuationRules_Title); }
            if (this.a_s_Categories_xml != null) { this.a_s_Categories_xml = ReplaceString.GetReplaceString(this.a_s_Categories_xml); }
            if (this.a_s_Categories_xml_Remark != null) { this.a_s_Categories_xml_Remark = ReplaceString.GetReplaceString(this.a_s_Categories_xml_Remark); }
            if (this.a_sApproval_Arrears_Man != null) { this.a_sApproval_Arrears_Man = ReplaceString.GetReplaceString(this.a_sApproval_Arrears_Man); }
            if (this.a_sContent != null) { this.a_sContent = ReplaceString.GetReplaceString(this.a_sContent); }
            if (this.a_s_Preordain_GuidBaseMedia_Fold_Page != null) { this.a_s_Preordain_GuidBaseMedia_Fold_Page = ReplaceString.GetReplaceString(this.a_s_Preordain_GuidBaseMedia_Fold_Page); }
            if (this.a_s_Preordain_NameBaseMedia_Fold_Page_Fold != null) { this.a_s_Preordain_NameBaseMedia_Fold_Page_Fold = ReplaceString.GetReplaceString(this.a_s_Preordain_NameBaseMedia_Fold_Page_Fold); }
            if (this.a_s_Preordain_NameBaseMedia_Fold_Page_FoldPage != null) { this.a_s_Preordain_NameBaseMedia_Fold_Page_FoldPage = ReplaceString.GetReplaceString(this.a_s_Preordain_NameBaseMedia_Fold_Page_FoldPage); }
            if (this.a_s_Publish_GuidBaseMedia_Fold_Page != null) { this.a_s_Publish_GuidBaseMedia_Fold_Page = ReplaceString.GetReplaceString(this.a_s_Publish_GuidBaseMedia_Fold_Page); }
            if (this.a_s_Publish_NameBaseMedia_Fold_Page_Fold != null) { this.a_s_Publish_NameBaseMedia_Fold_Page_Fold = ReplaceString.GetReplaceString(this.a_s_Publish_NameBaseMedia_Fold_Page_Fold); }
            if (this.a_s_Publish_NameBaseMedia_Fold_Page_FoldPage != null) { this.a_s_Publish_NameBaseMedia_Fold_Page_FoldPage = ReplaceString.GetReplaceString(this.a_s_Publish_NameBaseMedia_Fold_Page_FoldPage); }
            if (this.a_s_Publish_NameOperator != null) { this.a_s_Publish_NameOperator = ReplaceString.GetReplaceString(this.a_s_Publish_NameOperator); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_s_cj_Path != null) { this.a_s_cj_Path = ReplaceString.GetReplaceString(this.a_s_cj_Path); }
            if (this.a_s_cj_filename != null) { this.a_s_cj_filename = ReplaceString.GetReplaceString(this.a_s_cj_filename); }
            if (this.a_s_cj_xml != null) { this.a_s_cj_xml = ReplaceString.GetReplaceString(this.a_s_cj_xml); }
            if (this.a_sHB_Operator != null) { this.a_sHB_Operator = ReplaceString.GetReplaceString(this.a_sHB_Operator); }
            if (this.a_sArrangePageStatus != null) { this.a_sArrangePageStatus = ReplaceString.GetReplaceString(this.a_sArrangePageStatus); }
            if (this.a_s_NameEditor != null) { this.a_s_NameEditor = ReplaceString.GetReplaceString(this.a_s_NameEditor); }
            if (this.a_sGuidBaseOrder_Project != null) { this.a_sGuidBaseOrder_Project = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_Project); }
            if (this.a_sNameBaseOrder_Project != null) { this.a_sNameBaseOrder_Project = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_Project); }
            if (this.a_sGuidBaseOrder_PagePosition_1 != null) { this.a_sGuidBaseOrder_PagePosition_1 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_PagePosition_1); }
            if (this.a_sNameBaseOrder_PagePosition_1 != null) { this.a_sNameBaseOrder_PagePosition_1 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_PagePosition_1); }
            if (this.a_sGuidBaseOrder_PagePosition_2 != null) { this.a_sGuidBaseOrder_PagePosition_2 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_PagePosition_2); }
            if (this.a_sNameBaseOrder_PagePosition_2 != null) { this.a_sNameBaseOrder_PagePosition_2 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_PagePosition_2); }
            if (this.a_sGuidBaseOrder_PagePosition_3 != null) { this.a_sGuidBaseOrder_PagePosition_3 = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_PagePosition_3); }
            if (this.a_sNameBaseOrder_PagePosition_3 != null) { this.a_sNameBaseOrder_PagePosition_3 = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_PagePosition_3); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkOrderItem( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkOrder != null) { mySqlScript += "sGuidWorkOrder,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_bFlagAdd != null) { mySqlScript += "bFlagAdd,"; }
            if (this.a_bFlagChange != null) { mySqlScript += "bFlagChange,"; }
            if (this.a_bFlagStop != null) { mySqlScript += "bFlagStop,"; }
            if (this.a_sGuidBaseOrder_AdvertisingType != null) { mySqlScript += "sGuidBaseOrder_AdvertisingType,"; }
            if (this.a_sNameBaseOrder_AdvertisingType != null) { mySqlScript += "sNameBaseOrder_AdvertisingType,"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "sGuidBaseMedia,"; }
            if (this.a_sNameBaseMedia != null) { mySqlScript += "sNameBaseMedia,"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "sGuidBasePrice_Media_PagePositionType,"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "sNameBasePrice_Media_PagePositionType,"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { mySqlScript += "sGuidBaseOrder_Industry_1,"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { mySqlScript += "sGuidBaseOrder_Industry_2,"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { mySqlScript += "sGuidBaseOrder_Industry_3,"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { mySqlScript += "sNameBaseOrder_Industry_1,"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { mySqlScript += "sNameBaseOrder_Industry_2,"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { mySqlScript += "sNameBaseOrder_Industry_3,"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { mySqlScript += "sGuidBasePrice_Media_Specification,"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { mySqlScript += "sNameBasePrice_Media_Specification,"; }
            if (this.a_sGuidBaseOrder_PaymentType != null) { mySqlScript += "sGuidBaseOrder_PaymentType,"; }
            if (this.a_sNameBaseOrder_PaymentType != null) { mySqlScript += "sNameBaseOrder_PaymentType,"; }
            if (this.a_sGuidBaseMedia_PriceTable != null) { mySqlScript += "sGuidBaseMedia_PriceTable,"; }
            if (this.a_sNameBaseMedia_PriceTable != null) { mySqlScript += "sNameBaseMedia_PriceTable,"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "sGuidBasePrice_Color,"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "sNameBasePrice_Color,"; }
            if (this.a_sGuidBaseCRM_Customer_Brand != null) { mySqlScript += "sGuidBaseCRM_Customer_Brand,"; }
            if (this.a_sNameBaseCRM_Customer_Brand != null) { mySqlScript += "sNameBaseCRM_Customer_Brand,"; }
            if (this.a_bCommissionReview != null) { mySqlScript += "bCommissionReview,"; }
            if (this.a_sCommissionReviewMan != null) { mySqlScript += "sCommissionReviewMan,"; }
            if (this.a_dCommissionReviewDate != null) { mySqlScript += "dCommissionReviewDate,"; }
            if (this.a_s_pic_path_file != null) { mySqlScript += "s_pic_path_file,"; }
            if (this.a_s_Categories_ValuationRules_Text != null) { mySqlScript += "s_Categories_ValuationRules_Text,"; }
            if (this.a_s_Categories_ValuationRules_Title != null) { mySqlScript += "s_Categories_ValuationRules_Title,"; }
            if (this.a_s_Categories_xml != null) { mySqlScript += "s_Categories_xml,"; }
            if (this.a_s_Categories_xml_Remark != null) { mySqlScript += "s_Categories_xml_Remark,"; }
            if (this.a_n_Categories_Count_Text != null) { mySqlScript += "n_Categories_Count_Text,"; }
            if (this.a_n_Categories_Count_Title != null) { mySqlScript += "n_Categories_Count_Title,"; }
            if (this.a_n_Categories_Price_Title != null) { mySqlScript += "n_Categories_Price_Title,"; }
            if (this.a_n_Categories_Price_Text != null) { mySqlScript += "n_Categories_Price_Text,"; }
            if (this.a_bApproval_Arrears != null) { mySqlScript += "bApproval_Arrears,"; }
            if (this.a_sApproval_Arrears_Man != null) { mySqlScript += "sApproval_Arrears_Man,"; }
            if (this.a_dApproval_Arrears_Date != null) { mySqlScript += "dApproval_Arrears_Date,"; }
            if (this.a_sContent != null) { mySqlScript += "sContent,"; }
            if (this.a_s_Preordain_GuidBaseMedia_Fold_Page != null) { mySqlScript += "s_Preordain_GuidBaseMedia_Fold_Page,"; }
            if (this.a_s_Preordain_NameBaseMedia_Fold_Page_Fold != null) { mySqlScript += "s_Preordain_NameBaseMedia_Fold_Page_Fold,"; }
            if (this.a_s_Preordain_NameBaseMedia_Fold_Page_FoldPage != null) { mySqlScript += "s_Preordain_NameBaseMedia_Fold_Page_FoldPage,"; }
            if (this.a_d_Preordain_Date != null) { mySqlScript += "d_Preordain_Date,"; }
            if (this.a_s_Publish_GuidBaseMedia_Fold_Page != null) { mySqlScript += "s_Publish_GuidBaseMedia_Fold_Page,"; }
            if (this.a_s_Publish_NameBaseMedia_Fold_Page_Fold != null) { mySqlScript += "s_Publish_NameBaseMedia_Fold_Page_Fold,"; }
            if (this.a_s_Publish_NameBaseMedia_Fold_Page_FoldPage != null) { mySqlScript += "s_Publish_NameBaseMedia_Fold_Page_FoldPage,"; }
            if (this.a_d_Publish_Date != null) { mySqlScript += "d_Publish_Date,"; }
            if (this.a_s_Publish_NameOperator != null) { mySqlScript += "s_Publish_NameOperator,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_s_cj_Path != null) { mySqlScript += "s_cj_Path,"; }
            if (this.a_s_cj_filename != null) { mySqlScript += "s_cj_filename,"; }
            if (this.a_s_cj_xml != null) { mySqlScript += "s_cj_xml,"; }
            if (this.a_b_HB != null) { mySqlScript += "b_HB,"; }
            if (this.a_b_HB_Lock != null) { mySqlScript += "b_HB_Lock,"; }
            if (this.a_n_HB_X != null) { mySqlScript += "n_HB_X,"; }
            if (this.a_n_HB_Y != null) { mySqlScript += "n_HB_Y,"; }
            if (this.a_d_HB_Date != null) { mySqlScript += "d_HB_Date,"; }
            if (this.a_sHB_Operator != null) { mySqlScript += "sHB_Operator,"; }
            if (this.a_sArrangePageStatus != null) { mySqlScript += "sArrangePageStatus,"; }
            if (this.a_nIncreaseProportion != null) { mySqlScript += "nIncreaseProportion,"; }
            if (this.a_n_Price_Standard != null) { mySqlScript += "n_Price_Standard,"; }
            if (this.a_n_Price_Signed != null) { mySqlScript += "n_Price_Signed,"; }
            if (this.a_nFee_Additional != null) { mySqlScript += "nFee_Additional,"; }
            if (this.a_nFee_MakePage != null) { mySqlScript += "nFee_MakePage,"; }
            if (this.a_n_Money_ClearArrears != null) { mySqlScript += "n_Money_ClearArrears,"; }
            if (this.a_n_Discount != null) { mySqlScript += "n_Discount,"; }
            if (this.a_s_NameEditor != null) { mySqlScript += "s_NameEditor,"; }
            if (this.a_iIssueNum_Current != null) { mySqlScript += "iIssueNum_Current,"; }
            if (this.a_iIssueNum_Total != null) { mySqlScript += "iIssueNum_Total,"; }
            if (this.a_i_Reward_CalculateCount != null) { mySqlScript += "i_Reward_CalculateCount,"; }
            if (this.a_bCustomerReturnMoney != null) { mySqlScript += "bCustomerReturnMoney,"; }
            if (this.a_sGuidBaseOrder_Project != null) { mySqlScript += "sGuidBaseOrder_Project,"; }
            if (this.a_sNameBaseOrder_Project != null) { mySqlScript += "sNameBaseOrder_Project,"; }
            if (this.a_sGuidBaseOrder_PagePosition_1 != null) { mySqlScript += "sGuidBaseOrder_PagePosition_1,"; }
            if (this.a_sNameBaseOrder_PagePosition_1 != null) { mySqlScript += "sNameBaseOrder_PagePosition_1,"; }
            if (this.a_sGuidBaseOrder_PagePosition_2 != null) { mySqlScript += "sGuidBaseOrder_PagePosition_2,"; }
            if (this.a_sNameBaseOrder_PagePosition_2 != null) { mySqlScript += "sNameBaseOrder_PagePosition_2,"; }
            if (this.a_sGuidBaseOrder_PagePosition_3 != null) { mySqlScript += "sGuidBaseOrder_PagePosition_3,"; }
            if (this.a_sNameBaseOrder_PagePosition_3 != null) { mySqlScript += "sNameBaseOrder_PagePosition_3,"; }
            if (this.a_bPresent != null) { mySqlScript += "bPresent,"; }
            if (this.a_bReverse != null) { mySqlScript += "bReverse,"; }
            if (this.a_nWidth != null) { mySqlScript += "nWidth,"; }
            if (this.a_nHeight != null) { mySqlScript += "nHeight,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_RowVersion != null) { mySqlScript += "RowVersion,"; }
            if (this.a_bValid != null) { mySqlScript += "bValid,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkOrder != null) { mySqlScript += "'" + this.a_sGuidWorkOrder + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_bFlagAdd != null) { mySqlScript += "'" + this.a_bFlagAdd + "',"; }
            if (this.a_bFlagChange != null) { mySqlScript += "'" + this.a_bFlagChange + "',"; }
            if (this.a_bFlagStop != null) { mySqlScript += "'" + this.a_bFlagStop + "',"; }
            if (this.a_sGuidBaseOrder_AdvertisingType != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_AdvertisingType + "',"; }
            if (this.a_sNameBaseOrder_AdvertisingType != null) { mySqlScript += "'" + this.a_sNameBaseOrder_AdvertisingType + "',"; }
            if (this.a_sGuidBaseMedia != null) { mySqlScript += "'" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_sNameBaseMedia != null) { mySqlScript += "'" + this.a_sNameBaseMedia + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_1 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_2 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Industry_3 + "',"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_1 + "',"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_2 + "',"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Industry_3 + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_Specification + "',"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_Specification + "',"; }
            if (this.a_sGuidBaseOrder_PaymentType != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_PaymentType + "',"; }
            if (this.a_sNameBaseOrder_PaymentType != null) { mySqlScript += "'" + this.a_sNameBaseOrder_PaymentType + "',"; }
            if (this.a_sGuidBaseMedia_PriceTable != null) { mySqlScript += "'" + this.a_sGuidBaseMedia_PriceTable + "',"; }
            if (this.a_sNameBaseMedia_PriceTable != null) { mySqlScript += "'" + this.a_sNameBaseMedia_PriceTable + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "'" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBaseCRM_Customer_Brand != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer_Brand + "',"; }
            if (this.a_sNameBaseCRM_Customer_Brand != null) { mySqlScript += "'" + this.a_sNameBaseCRM_Customer_Brand + "',"; }
            if (this.a_bCommissionReview != null) { mySqlScript += "'" + this.a_bCommissionReview + "',"; }
            if (this.a_sCommissionReviewMan != null) { mySqlScript += "'" + this.a_sCommissionReviewMan + "',"; }
            if (this.a_dCommissionReviewDate != null) { mySqlScript += "'" + this.a_dCommissionReviewDate + "',"; }
            if (this.a_s_pic_path_file != null) { mySqlScript += "'" + this.a_s_pic_path_file + "',"; }
            if (this.a_s_Categories_ValuationRules_Text != null) { mySqlScript += "'" + this.a_s_Categories_ValuationRules_Text + "',"; }
            if (this.a_s_Categories_ValuationRules_Title != null) { mySqlScript += "'" + this.a_s_Categories_ValuationRules_Title + "',"; }
            if (this.a_s_Categories_xml != null) { mySqlScript += "'" + this.a_s_Categories_xml + "',"; }
            if (this.a_s_Categories_xml_Remark != null) { mySqlScript += "'" + this.a_s_Categories_xml_Remark + "',"; }
            if (this.a_n_Categories_Count_Text != null) { mySqlScript += this.a_n_Categories_Count_Text + ","; }
            if (this.a_n_Categories_Count_Title != null) { mySqlScript += this.a_n_Categories_Count_Title + ","; }
            if (this.a_n_Categories_Price_Title != null) { mySqlScript += this.a_n_Categories_Price_Title + ","; }
            if (this.a_n_Categories_Price_Text != null) { mySqlScript += this.a_n_Categories_Price_Text + ","; }
            if (this.a_bApproval_Arrears != null) { mySqlScript += "'" + this.a_bApproval_Arrears + "',"; }
            if (this.a_sApproval_Arrears_Man != null) { mySqlScript += "'" + this.a_sApproval_Arrears_Man + "',"; }
            if (this.a_dApproval_Arrears_Date != null) { mySqlScript += "'" + this.a_dApproval_Arrears_Date + "',"; }
            if (this.a_sContent != null) { mySqlScript += "'" + this.a_sContent + "',"; }
            if (this.a_s_Preordain_GuidBaseMedia_Fold_Page != null) { mySqlScript += "'" + this.a_s_Preordain_GuidBaseMedia_Fold_Page + "',"; }
            if (this.a_s_Preordain_NameBaseMedia_Fold_Page_Fold != null) { mySqlScript += "'" + this.a_s_Preordain_NameBaseMedia_Fold_Page_Fold + "',"; }
            if (this.a_s_Preordain_NameBaseMedia_Fold_Page_FoldPage != null) { mySqlScript += "'" + this.a_s_Preordain_NameBaseMedia_Fold_Page_FoldPage + "',"; }
            if (this.a_d_Preordain_Date != null) { mySqlScript += "'" + this.a_d_Preordain_Date + "',"; }
            if (this.a_s_Publish_GuidBaseMedia_Fold_Page != null) { mySqlScript += "'" + this.a_s_Publish_GuidBaseMedia_Fold_Page + "',"; }
            if (this.a_s_Publish_NameBaseMedia_Fold_Page_Fold != null) { mySqlScript += "'" + this.a_s_Publish_NameBaseMedia_Fold_Page_Fold + "',"; }
            if (this.a_s_Publish_NameBaseMedia_Fold_Page_FoldPage != null) { mySqlScript += "'" + this.a_s_Publish_NameBaseMedia_Fold_Page_FoldPage + "',"; }
            if (this.a_d_Publish_Date != null) { mySqlScript += "'" + this.a_d_Publish_Date + "',"; }
            if (this.a_s_Publish_NameOperator != null) { mySqlScript += "'" + this.a_s_Publish_NameOperator + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_s_cj_Path != null) { mySqlScript += "'" + this.a_s_cj_Path + "',"; }
            if (this.a_s_cj_filename != null) { mySqlScript += "'" + this.a_s_cj_filename + "',"; }
            if (this.a_s_cj_xml != null) { mySqlScript += "'" + this.a_s_cj_xml + "',"; }
            if (this.a_b_HB != null) { mySqlScript += "'" + this.a_b_HB + "',"; }
            if (this.a_b_HB_Lock != null) { mySqlScript += "'" + this.a_b_HB_Lock + "',"; }
            if (this.a_n_HB_X != null) { mySqlScript += this.a_n_HB_X + ","; }
            if (this.a_n_HB_Y != null) { mySqlScript += this.a_n_HB_Y + ","; }
            if (this.a_d_HB_Date != null) { mySqlScript += "'" + this.a_d_HB_Date + "',"; }
            if (this.a_sHB_Operator != null) { mySqlScript += "'" + this.a_sHB_Operator + "',"; }
            if (this.a_sArrangePageStatus != null) { mySqlScript += "'" + this.a_sArrangePageStatus + "',"; }
            if (this.a_nIncreaseProportion != null) { mySqlScript += this.a_nIncreaseProportion + ","; }
            if (this.a_n_Price_Standard != null) { mySqlScript += this.a_n_Price_Standard + ","; }
            if (this.a_n_Price_Signed != null) { mySqlScript += this.a_n_Price_Signed + ","; }
            if (this.a_nFee_Additional != null) { mySqlScript += this.a_nFee_Additional + ","; }
            if (this.a_nFee_MakePage != null) { mySqlScript += this.a_nFee_MakePage + ","; }
            if (this.a_n_Money_ClearArrears != null) { mySqlScript += this.a_n_Money_ClearArrears + ","; }
            if (this.a_n_Discount != null) { mySqlScript += this.a_n_Discount + ","; }
            if (this.a_s_NameEditor != null) { mySqlScript += "'" + this.a_s_NameEditor + "',"; }
            if (this.a_iIssueNum_Current != null) { mySqlScript += this.a_iIssueNum_Current + ","; }
            if (this.a_iIssueNum_Total != null) { mySqlScript += this.a_iIssueNum_Total + ","; }
            if (this.a_i_Reward_CalculateCount != null) { mySqlScript += this.a_i_Reward_CalculateCount + ","; }
            if (this.a_bCustomerReturnMoney != null) { mySqlScript += "'" + this.a_bCustomerReturnMoney + "',"; }
            if (this.a_sGuidBaseOrder_Project != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_Project + "',"; }
            if (this.a_sNameBaseOrder_Project != null) { mySqlScript += "'" + this.a_sNameBaseOrder_Project + "',"; }
            if (this.a_sGuidBaseOrder_PagePosition_1 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_PagePosition_1 + "',"; }
            if (this.a_sNameBaseOrder_PagePosition_1 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_PagePosition_1 + "',"; }
            if (this.a_sGuidBaseOrder_PagePosition_2 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_PagePosition_2 + "',"; }
            if (this.a_sNameBaseOrder_PagePosition_2 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_PagePosition_2 + "',"; }
            if (this.a_sGuidBaseOrder_PagePosition_3 != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_PagePosition_3 + "',"; }
            if (this.a_sNameBaseOrder_PagePosition_3 != null) { mySqlScript += "'" + this.a_sNameBaseOrder_PagePosition_3 + "',"; }
            if (this.a_bPresent != null) { mySqlScript += "'" + this.a_bPresent + "',"; }
            if (this.a_bReverse != null) { mySqlScript += "'" + this.a_bReverse + "',"; }
            if (this.a_nWidth != null) { mySqlScript += this.a_nWidth + ","; }
            if (this.a_nHeight != null) { mySqlScript += this.a_nHeight + ","; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_RowVersion != null) { mySqlScript += "'" + this.a_RowVersion + "',"; }
            if (this.a_bValid != null) { mySqlScript += "'" + this.a_bValid + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkOrderItem set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkOrder != null) { iColumnCount++; mySqlScript += " sGuidWorkOrder = '" + this.a_sGuidWorkOrder + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_bFlagAdd != null) { iColumnCount++; mySqlScript += " bFlagAdd = '" + this.a_bFlagAdd + "',"; }
            if (this.a_bFlagChange != null) { iColumnCount++; mySqlScript += " bFlagChange = '" + this.a_bFlagChange + "',"; }
            if (this.a_bFlagStop != null) { iColumnCount++; mySqlScript += " bFlagStop = '" + this.a_bFlagStop + "',"; }
            if (this.a_sGuidBaseOrder_AdvertisingType != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_AdvertisingType = '" + this.a_sGuidBaseOrder_AdvertisingType + "',"; }
            if (this.a_sNameBaseOrder_AdvertisingType != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_AdvertisingType = '" + this.a_sNameBaseOrder_AdvertisingType + "',"; }
            if (this.a_sGuidBaseMedia != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia = '" + this.a_sGuidBaseMedia + "',"; }
            if (this.a_sNameBaseMedia != null) { iColumnCount++; mySqlScript += " sNameBaseMedia = '" + this.a_sNameBaseMedia + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_PagePositionType = '" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_PagePositionType = '" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBaseOrder_Industry_1 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_1 = '" + this.a_sGuidBaseOrder_Industry_1 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_2 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_2 = '" + this.a_sGuidBaseOrder_Industry_2 + "',"; }
            if (this.a_sGuidBaseOrder_Industry_3 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Industry_3 = '" + this.a_sGuidBaseOrder_Industry_3 + "',"; }
            if (this.a_sNameBaseOrder_Industry_1 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_1 = '" + this.a_sNameBaseOrder_Industry_1 + "',"; }
            if (this.a_sNameBaseOrder_Industry_2 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_2 = '" + this.a_sNameBaseOrder_Industry_2 + "',"; }
            if (this.a_sNameBaseOrder_Industry_3 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Industry_3 = '" + this.a_sNameBaseOrder_Industry_3 + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_Specification = '" + this.a_sGuidBasePrice_Media_Specification + "',"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_Specification = '" + this.a_sNameBasePrice_Media_Specification + "',"; }
            if (this.a_sGuidBaseOrder_PaymentType != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_PaymentType = '" + this.a_sGuidBaseOrder_PaymentType + "',"; }
            if (this.a_sNameBaseOrder_PaymentType != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_PaymentType = '" + this.a_sNameBaseOrder_PaymentType + "',"; }
            if (this.a_sGuidBaseMedia_PriceTable != null) { iColumnCount++; mySqlScript += " sGuidBaseMedia_PriceTable = '" + this.a_sGuidBaseMedia_PriceTable + "',"; }
            if (this.a_sNameBaseMedia_PriceTable != null) { iColumnCount++; mySqlScript += " sNameBaseMedia_PriceTable = '" + this.a_sNameBaseMedia_PriceTable + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Color = '" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Color = '" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBaseCRM_Customer_Brand != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer_Brand = '" + this.a_sGuidBaseCRM_Customer_Brand + "',"; }
            if (this.a_sNameBaseCRM_Customer_Brand != null) { iColumnCount++; mySqlScript += " sNameBaseCRM_Customer_Brand = '" + this.a_sNameBaseCRM_Customer_Brand + "',"; }
            if (this.a_bCommissionReview != null) { iColumnCount++; mySqlScript += " bCommissionReview = '" + this.a_bCommissionReview + "',"; }
            if (this.a_sCommissionReviewMan != null) { iColumnCount++; mySqlScript += " sCommissionReviewMan = '" + this.a_sCommissionReviewMan + "',"; }
            if (this.a_dCommissionReviewDate != null) { iColumnCount++; mySqlScript += " dCommissionReviewDate = '" + this.a_dCommissionReviewDate + "',"; }
            if (this.a_s_pic_path_file != null) { iColumnCount++; mySqlScript += " s_pic_path_file = '" + this.a_s_pic_path_file + "',"; }
            if (this.a_s_Categories_ValuationRules_Text != null) { iColumnCount++; mySqlScript += " s_Categories_ValuationRules_Text = '" + this.a_s_Categories_ValuationRules_Text + "',"; }
            if (this.a_s_Categories_ValuationRules_Title != null) { iColumnCount++; mySqlScript += " s_Categories_ValuationRules_Title = '" + this.a_s_Categories_ValuationRules_Title + "',"; }
            if (this.a_s_Categories_xml != null) { iColumnCount++; mySqlScript += " s_Categories_xml = '" + this.a_s_Categories_xml + "',"; }
            if (this.a_s_Categories_xml_Remark != null) { iColumnCount++; mySqlScript += " s_Categories_xml_Remark = '" + this.a_s_Categories_xml_Remark + "',"; }
            if (this.a_n_Categories_Count_Text != null) { iColumnCount++; mySqlScript += " n_Categories_Count_Text = " + this.a_n_Categories_Count_Text + ","; }
            if (this.a_n_Categories_Count_Title != null) { iColumnCount++; mySqlScript += " n_Categories_Count_Title = " + this.a_n_Categories_Count_Title + ","; }
            if (this.a_n_Categories_Price_Title != null) { iColumnCount++; mySqlScript += " n_Categories_Price_Title = " + this.a_n_Categories_Price_Title + ","; }
            if (this.a_n_Categories_Price_Text != null) { iColumnCount++; mySqlScript += " n_Categories_Price_Text = " + this.a_n_Categories_Price_Text + ","; }
            if (this.a_bApproval_Arrears != null) { iColumnCount++; mySqlScript += " bApproval_Arrears = '" + this.a_bApproval_Arrears + "',"; }
            if (this.a_sApproval_Arrears_Man != null) { iColumnCount++; mySqlScript += " sApproval_Arrears_Man = '" + this.a_sApproval_Arrears_Man + "',"; }
            if (this.a_dApproval_Arrears_Date != null) { iColumnCount++; mySqlScript += " dApproval_Arrears_Date = '" + this.a_dApproval_Arrears_Date + "',"; }
            if (this.a_sContent != null) { iColumnCount++; mySqlScript += " sContent = '" + this.a_sContent + "',"; }
            if (this.a_s_Preordain_GuidBaseMedia_Fold_Page != null) { iColumnCount++; mySqlScript += " s_Preordain_GuidBaseMedia_Fold_Page = '" + this.a_s_Preordain_GuidBaseMedia_Fold_Page + "',"; }
            if (this.a_s_Preordain_NameBaseMedia_Fold_Page_Fold != null) { iColumnCount++; mySqlScript += " s_Preordain_NameBaseMedia_Fold_Page_Fold = '" + this.a_s_Preordain_NameBaseMedia_Fold_Page_Fold + "',"; }
            if (this.a_s_Preordain_NameBaseMedia_Fold_Page_FoldPage != null) { iColumnCount++; mySqlScript += " s_Preordain_NameBaseMedia_Fold_Page_FoldPage = '" + this.a_s_Preordain_NameBaseMedia_Fold_Page_FoldPage + "',"; }
            if (this.a_d_Preordain_Date != null) { iColumnCount++; mySqlScript += " d_Preordain_Date = '" + this.a_d_Preordain_Date + "',"; }
            if (this.a_s_Publish_GuidBaseMedia_Fold_Page != null) { iColumnCount++; mySqlScript += " s_Publish_GuidBaseMedia_Fold_Page = '" + this.a_s_Publish_GuidBaseMedia_Fold_Page + "',"; }
            if (this.a_s_Publish_NameBaseMedia_Fold_Page_Fold != null) { iColumnCount++; mySqlScript += " s_Publish_NameBaseMedia_Fold_Page_Fold = '" + this.a_s_Publish_NameBaseMedia_Fold_Page_Fold + "',"; }
            if (this.a_s_Publish_NameBaseMedia_Fold_Page_FoldPage != null) { iColumnCount++; mySqlScript += " s_Publish_NameBaseMedia_Fold_Page_FoldPage = '" + this.a_s_Publish_NameBaseMedia_Fold_Page_FoldPage + "',"; }
            if (this.a_d_Publish_Date != null) { iColumnCount++; mySqlScript += " d_Publish_Date = '" + this.a_d_Publish_Date + "',"; }
            if (this.a_s_Publish_NameOperator != null) { iColumnCount++; mySqlScript += " s_Publish_NameOperator = '" + this.a_s_Publish_NameOperator + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_s_cj_Path != null) { iColumnCount++; mySqlScript += " s_cj_Path = '" + this.a_s_cj_Path + "',"; }
            if (this.a_s_cj_filename != null) { iColumnCount++; mySqlScript += " s_cj_filename = '" + this.a_s_cj_filename + "',"; }
            if (this.a_s_cj_xml != null) { iColumnCount++; mySqlScript += " s_cj_xml = '" + this.a_s_cj_xml + "',"; }
            if (this.a_b_HB != null) { iColumnCount++; mySqlScript += " b_HB = '" + this.a_b_HB + "',"; }
            if (this.a_b_HB_Lock != null) { iColumnCount++; mySqlScript += " b_HB_Lock = '" + this.a_b_HB_Lock + "',"; }
            if (this.a_n_HB_X != null) { iColumnCount++; mySqlScript += " n_HB_X = " + this.a_n_HB_X + ","; }
            if (this.a_n_HB_Y != null) { iColumnCount++; mySqlScript += " n_HB_Y = " + this.a_n_HB_Y + ","; }
            if (this.a_d_HB_Date != null) { iColumnCount++; mySqlScript += " d_HB_Date = '" + this.a_d_HB_Date + "',"; }
            if (this.a_sHB_Operator != null) { iColumnCount++; mySqlScript += " sHB_Operator = '" + this.a_sHB_Operator + "',"; }
            if (this.a_sArrangePageStatus != null) { iColumnCount++; mySqlScript += " sArrangePageStatus = '" + this.a_sArrangePageStatus + "',"; }
            if (this.a_nIncreaseProportion != null) { iColumnCount++; mySqlScript += " nIncreaseProportion = " + this.a_nIncreaseProportion + ","; }
            if (this.a_n_Price_Standard != null) { iColumnCount++; mySqlScript += " n_Price_Standard = " + this.a_n_Price_Standard + ","; }
            if (this.a_n_Price_Signed != null) { iColumnCount++; mySqlScript += " n_Price_Signed = " + this.a_n_Price_Signed + ","; }
            if (this.a_nFee_Additional != null) { iColumnCount++; mySqlScript += " nFee_Additional = " + this.a_nFee_Additional + ","; }
            if (this.a_nFee_MakePage != null) { iColumnCount++; mySqlScript += " nFee_MakePage = " + this.a_nFee_MakePage + ","; }
            if (this.a_n_Money_ClearArrears != null) { iColumnCount++; mySqlScript += " n_Money_ClearArrears = " + this.a_n_Money_ClearArrears + ","; }
            if (this.a_n_Discount != null) { iColumnCount++; mySqlScript += " n_Discount = " + this.a_n_Discount + ","; }
            if (this.a_s_NameEditor != null) { iColumnCount++; mySqlScript += " s_NameEditor = '" + this.a_s_NameEditor + "',"; }
            if (this.a_iIssueNum_Current != null) { iColumnCount++; mySqlScript += " iIssueNum_Current = " + this.a_iIssueNum_Current + ","; }
            if (this.a_iIssueNum_Total != null) { iColumnCount++; mySqlScript += " iIssueNum_Total = " + this.a_iIssueNum_Total + ","; }
            if (this.a_i_Reward_CalculateCount != null) { iColumnCount++; mySqlScript += " i_Reward_CalculateCount = " + this.a_i_Reward_CalculateCount + ","; }
            if (this.a_bCustomerReturnMoney != null) { iColumnCount++; mySqlScript += " bCustomerReturnMoney = '" + this.a_bCustomerReturnMoney + "',"; }
            if (this.a_sGuidBaseOrder_Project != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_Project = '" + this.a_sGuidBaseOrder_Project + "',"; }
            if (this.a_sNameBaseOrder_Project != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_Project = '" + this.a_sNameBaseOrder_Project + "',"; }
            if (this.a_sGuidBaseOrder_PagePosition_1 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_PagePosition_1 = '" + this.a_sGuidBaseOrder_PagePosition_1 + "',"; }
            if (this.a_sNameBaseOrder_PagePosition_1 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_PagePosition_1 = '" + this.a_sNameBaseOrder_PagePosition_1 + "',"; }
            if (this.a_sGuidBaseOrder_PagePosition_2 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_PagePosition_2 = '" + this.a_sGuidBaseOrder_PagePosition_2 + "',"; }
            if (this.a_sNameBaseOrder_PagePosition_2 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_PagePosition_2 = '" + this.a_sNameBaseOrder_PagePosition_2 + "',"; }
            if (this.a_sGuidBaseOrder_PagePosition_3 != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_PagePosition_3 = '" + this.a_sGuidBaseOrder_PagePosition_3 + "',"; }
            if (this.a_sNameBaseOrder_PagePosition_3 != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_PagePosition_3 = '" + this.a_sNameBaseOrder_PagePosition_3 + "',"; }
            if (this.a_bPresent != null) { iColumnCount++; mySqlScript += " bPresent = '" + this.a_bPresent + "',"; }
            if (this.a_bReverse != null) { iColumnCount++; mySqlScript += " bReverse = '" + this.a_bReverse + "',"; }
            if (this.a_nWidth != null) { iColumnCount++; mySqlScript += " nWidth = " + this.a_nWidth + ","; }
            if (this.a_nHeight != null) { iColumnCount++; mySqlScript += " nHeight = " + this.a_nHeight + ","; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_RowVersion != null) { iColumnCount++; mySqlScript += " RowVersion = '" + this.a_RowVersion + "',"; }
            if (this.a_bValid != null) { iColumnCount++; mySqlScript += " bValid = '" + this.a_bValid + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkOrderItem Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //刊期平帐( WorkOrderItem_Charge )  
    /// <summary>
    /// 刊期平帐
    /// </summary>
    public partial class Sql_WorkOrderItem_Charge
    {
        #region 与数据表(刊期平帐)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 收费ID 
        /// </summary> 
        public System.String a_sGuidWorkCharge = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 平帐种类(收款平帐/预收款平帐/平帐退回) 
        /// </summary> 
        public System.String a_sClearArrearsType = null;
        /// <summary> 
        /// 平帐金额 
        /// </summary> 
        public System.Double? a_nClearArrearsMoney = null;
        /// <summary> 
        /// 平帐日期 
        /// </summary> 
        public System.DateTime? a_dClearArrearsDate = null;
        /// <summary> 
        /// 已经计算佣金 
        /// </summary> 
        public System.Boolean? a_bCommission = null;
        /// <summary> 
        /// 是否计算公关部佣金 
        /// </summary> 
        public System.Boolean? a_bCommission_PublicRelations = null;
        /// <summary> 
        /// 已经计算组稿费 
        /// </summary> 
        public System.Boolean? a_bDeputy = null;
        /// <summary> 
        /// 已经计算返回金 
        /// </summary> 
        public System.Boolean? a_bReturnMoney = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkCharge != null) { this.a_sGuidWorkCharge = ReplaceString.GetReplaceString(this.a_sGuidWorkCharge); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sClearArrearsType != null) { this.a_sClearArrearsType = ReplaceString.GetReplaceString(this.a_sClearArrearsType); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkOrderItem_Charge( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkCharge != null) { mySqlScript += "sGuidWorkCharge,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_sClearArrearsType != null) { mySqlScript += "sClearArrearsType,"; }
            if (this.a_nClearArrearsMoney != null) { mySqlScript += "nClearArrearsMoney,"; }
            if (this.a_dClearArrearsDate != null) { mySqlScript += "dClearArrearsDate,"; }
            if (this.a_bCommission != null) { mySqlScript += "bCommission,"; }
            if (this.a_bCommission_PublicRelations != null) { mySqlScript += "bCommission_PublicRelations,"; }
            if (this.a_bDeputy != null) { mySqlScript += "bDeputy,"; }
            if (this.a_bReturnMoney != null) { mySqlScript += "bReturnMoney,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkCharge != null) { mySqlScript += "'" + this.a_sGuidWorkCharge + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sClearArrearsType != null) { mySqlScript += "'" + this.a_sClearArrearsType + "',"; }
            if (this.a_nClearArrearsMoney != null) { mySqlScript += this.a_nClearArrearsMoney + ","; }
            if (this.a_dClearArrearsDate != null) { mySqlScript += "'" + this.a_dClearArrearsDate + "',"; }
            if (this.a_bCommission != null) { mySqlScript += "'" + this.a_bCommission + "',"; }
            if (this.a_bCommission_PublicRelations != null) { mySqlScript += "'" + this.a_bCommission_PublicRelations + "',"; }
            if (this.a_bDeputy != null) { mySqlScript += "'" + this.a_bDeputy + "',"; }
            if (this.a_bReturnMoney != null) { mySqlScript += "'" + this.a_bReturnMoney + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkOrderItem_Charge set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkCharge != null) { iColumnCount++; mySqlScript += " sGuidWorkCharge = '" + this.a_sGuidWorkCharge + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sClearArrearsType != null) { iColumnCount++; mySqlScript += " sClearArrearsType = '" + this.a_sClearArrearsType + "',"; }
            if (this.a_nClearArrearsMoney != null) { iColumnCount++; mySqlScript += " nClearArrearsMoney = " + this.a_nClearArrearsMoney + ","; }
            if (this.a_dClearArrearsDate != null) { iColumnCount++; mySqlScript += " dClearArrearsDate = '" + this.a_dClearArrearsDate + "',"; }
            if (this.a_bCommission != null) { iColumnCount++; mySqlScript += " bCommission = '" + this.a_bCommission + "',"; }
            if (this.a_bCommission_PublicRelations != null) { iColumnCount++; mySqlScript += " bCommission_PublicRelations = '" + this.a_bCommission_PublicRelations + "',"; }
            if (this.a_bDeputy != null) { iColumnCount++; mySqlScript += " bDeputy = '" + this.a_bDeputy + "',"; }
            if (this.a_bReturnMoney != null) { iColumnCount++; mySqlScript += " bReturnMoney = '" + this.a_bReturnMoney + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkOrderItem_Charge Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //业务员分配比例( WorkOrderItem_Percentage_Employee )  
    /// <summary>
    /// 业务员分配比例
    /// </summary>
    public partial class Sql_WorkOrderItem_Percentage_Employee
    {
        #region 与数据表(业务员分配比例)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 部门1级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_1 = null;
        /// <summary> 
        /// 部门2级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_2 = null;
        /// <summary> 
        /// 部门3级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_3 = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 部门1级 
        /// </summary> 
        public System.String a_sNameBase_Department_1 = null;
        /// <summary> 
        /// 部门2级 
        /// </summary> 
        public System.String a_sNameBase_Department_2 = null;
        /// <summary> 
        /// 部门3级 
        /// </summary> 
        public System.String a_sNameBase_Department_3 = null;
        /// <summary> 
        /// 业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 业务员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person = null;
        /// <summary> 
        /// 年度欠款处罚标志 
        /// </summary> 
        public System.Boolean? a_bYearFine = null;
        /// <summary> 
        /// 佣金比例 
        /// </summary> 
        public System.Double? a_nPercentage_Commission = null;
        /// <summary> 
        /// 业绩比例 
        /// </summary> 
        public System.Double? a_nPercentage_Achievement = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sGuidBase_Department_1 != null) { this.a_sGuidBase_Department_1 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_1); }
            if (this.a_sGuidBase_Department_2 != null) { this.a_sGuidBase_Department_2 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_2); }
            if (this.a_sGuidBase_Department_3 != null) { this.a_sGuidBase_Department_3 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_3); }
            if (this.a_sNameBase_Department_1 != null) { this.a_sNameBase_Department_1 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_1); }
            if (this.a_sNameBase_Department_2 != null) { this.a_sNameBase_Department_2 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_2); }
            if (this.a_sNameBase_Department_3 != null) { this.a_sNameBase_Department_3 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_3); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sNameBase_Department_Person != null) { this.a_sNameBase_Department_Person = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkOrderItem_Percentage_Employee( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "sGuidBase_Department_1,"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "sGuidBase_Department_2,"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "sGuidBase_Department_3,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "sNameBase_Department_1,"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "sNameBase_Department_2,"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "sNameBase_Department_3,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "sNameBase_Department_Person,"; }
            if (this.a_bYearFine != null) { mySqlScript += "bYearFine,"; }
            if (this.a_nPercentage_Commission != null) { mySqlScript += "nPercentage_Commission,"; }
            if (this.a_nPercentage_Achievement != null) { mySqlScript += "nPercentage_Achievement,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "'" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "'" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "'" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_bYearFine != null) { mySqlScript += "'" + this.a_bYearFine + "',"; }
            if (this.a_nPercentage_Commission != null) { mySqlScript += this.a_nPercentage_Commission + ","; }
            if (this.a_nPercentage_Achievement != null) { mySqlScript += this.a_nPercentage_Achievement + ","; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkOrderItem_Percentage_Employee set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_1 = '" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_2 = '" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_3 = '" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBase_Department_1 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_1 = '" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_2 = '" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_3 = '" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person = '" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_bYearFine != null) { iColumnCount++; mySqlScript += " bYearFine = '" + this.a_bYearFine + "',"; }
            if (this.a_nPercentage_Commission != null) { iColumnCount++; mySqlScript += " nPercentage_Commission = " + this.a_nPercentage_Commission + ","; }
            if (this.a_nPercentage_Achievement != null) { iColumnCount++; mySqlScript += " nPercentage_Achievement = " + this.a_nPercentage_Achievement + ","; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkOrderItem_Percentage_Employee Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //公关人分配比例( WorkOrderItem_Percentage_PublicRelation )  
    /// <summary>
    /// 公关人分配比例
    /// </summary>
    public partial class Sql_WorkOrderItem_Percentage_PublicRelation
    {
        #region 与数据表(公关人分配比例)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 刊期 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 部门1级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_1 = null;
        /// <summary> 
        /// 部门2级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_2 = null;
        /// <summary> 
        /// 部门3级ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_3 = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 部门1级 
        /// </summary> 
        public System.String a_sNameBase_Department_1 = null;
        /// <summary> 
        /// 部门2级 
        /// </summary> 
        public System.String a_sNameBase_Department_2 = null;
        /// <summary> 
        /// 部门3级 
        /// </summary> 
        public System.String a_sNameBase_Department_3 = null;
        /// <summary> 
        /// 公关人ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 公关人 
        /// </summary> 
        public System.String a_sNameBase_Department_Person = null;
        /// <summary> 
        /// 佣金比例 
        /// </summary> 
        public System.Double? a_nPercentage_Commission = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sGuidBase_Department_1 != null) { this.a_sGuidBase_Department_1 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_1); }
            if (this.a_sGuidBase_Department_2 != null) { this.a_sGuidBase_Department_2 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_2); }
            if (this.a_sGuidBase_Department_3 != null) { this.a_sGuidBase_Department_3 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_3); }
            if (this.a_sNameBase_Department_1 != null) { this.a_sNameBase_Department_1 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_1); }
            if (this.a_sNameBase_Department_2 != null) { this.a_sNameBase_Department_2 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_2); }
            if (this.a_sNameBase_Department_3 != null) { this.a_sNameBase_Department_3 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_3); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sNameBase_Department_Person != null) { this.a_sNameBase_Department_Person = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkOrderItem_Percentage_PublicRelation( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "sGuidBase_Department_1,"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "sGuidBase_Department_2,"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "sGuidBase_Department_3,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "sNameBase_Department_1,"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "sNameBase_Department_2,"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "sNameBase_Department_3,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "sNameBase_Department_Person,"; }
            if (this.a_nPercentage_Commission != null) { mySqlScript += "nPercentage_Commission,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "'" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "'" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "'" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_nPercentage_Commission != null) { mySqlScript += this.a_nPercentage_Commission + ","; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkOrderItem_Percentage_PublicRelation set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_1 = '" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_2 = '" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_3 = '" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBase_Department_1 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_1 = '" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_2 = '" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_3 = '" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person = '" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_nPercentage_Commission != null) { iColumnCount++; mySqlScript += " nPercentage_Commission = " + this.a_nPercentage_Commission + ","; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkOrderItem_Percentage_PublicRelation Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //刊期的比例(佣金/业绩/任务)( WorkOrderItem_Proportion )  
    /// <summary>
    /// 刊期的比例(佣金/业绩/任务)
    /// </summary>
    public partial class Sql_WorkOrderItem_Proportion
    {
        #region 与数据表(刊期的比例(佣金/业绩/任务))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 任务比例_业务员 
        /// </summary> 
        public System.Double? a_nTask_Employee = null;
        /// <summary> 
        /// 任务比例_公关部 
        /// </summary> 
        public System.Double? a_nTask_PublicRelations = null;
        /// <summary> 
        /// 佣金比例_业务员 
        /// </summary> 
        public System.Double? a_nCommission_Employee = null;
        /// <summary> 
        /// 佣金比例_公关人 
        /// </summary> 
        public System.Double? a_nCommission_PublicRelations = null;
        /// <summary> 
        /// 佣金比例_业务部门1级 
        /// </summary> 
        public System.Double? a_nCommission_Department_Employee_1 = null;
        /// <summary> 
        /// 佣金比例_业务部门2级 
        /// </summary> 
        public System.Double? a_nCommission_Department_Employee_2 = null;
        /// <summary> 
        /// 佣金比例_公关部门1级 
        /// </summary> 
        public System.Double? a_nCommission_Department_PublicRelations_1 = null;
        /// <summary> 
        /// 佣金比例_公关部门2级 
        /// </summary> 
        public System.Double? a_nCommission_Department_PublicRelations_2 = null;
        /// <summary> 
        /// 累计佣金比例_业务员 
        /// </summary> 
        public System.Double? a_nTotalCommission_Employee = null;
        /// <summary> 
        /// 年奖_业务员 
        /// </summary> 
        public System.Double? a_nYearAward_Employee = null;
        /// <summary> 
        /// 年奖_公关人 
        /// </summary> 
        public System.Double? a_nYearAward_PublicRelations = null;
        /// <summary> 
        /// 年奖_部门_业务1级 
        /// </summary> 
        public System.Double? a_nYearAward_Department_Employee_1 = null;
        /// <summary> 
        /// 年奖_部门_业务2级 
        /// </summary> 
        public System.Double? a_nYearAward_Department_Employee_2 = null;
        /// <summary> 
        /// 年奖_部门_公关1级 
        /// </summary> 
        public System.Double? a_nYearAward_Department_PublicRelations_1 = null;
        /// <summary> 
        /// 年奖_部门_公关2级 
        /// </summary> 
        public System.Double? a_nYearAward_Department_PublicRelations_2 = null;
        /// <summary> 
        /// 季奖_业务员 
        /// </summary> 
        public System.Double? a_nQuarterAward_Employee = null;
        /// <summary> 
        /// 季奖_公关人 
        /// </summary> 
        public System.Double? a_nQuarterAward_PublicRelations = null;
        /// <summary> 
        /// 季奖_部门_业务1级 
        /// </summary> 
        public System.Double? a_nQuarterAward_Department_Employee_1 = null;
        /// <summary> 
        /// 季奖_部门_业务2级 
        /// </summary> 
        public System.Double? a_nQuarterAward_Department_Employee_2 = null;
        /// <summary> 
        /// 季奖_部门_公关1级 
        /// </summary> 
        public System.Double? a_nQuarterAward_Department_PublicRelations_1 = null;
        /// <summary> 
        /// 季奖_部门_公关2级 
        /// </summary> 
        public System.Double? a_nQuarterAward_Department_PublicRelations_2 = null;
        /// <summary> 
        /// 月奖_业务员 
        /// </summary> 
        public System.Double? a_nMonthAward_Employee = null;
        /// <summary> 
        /// 月奖_公关人 
        /// </summary> 
        public System.Double? a_nMonthAward_PublicRelations = null;
        /// <summary> 
        /// 月奖_部门_业务1级 
        /// </summary> 
        public System.Double? a_nMonthAward_Department_Employee_1 = null;
        /// <summary> 
        /// 月奖_部门_业务2级 
        /// </summary> 
        public System.Double? a_nMonthAward_Department_Employee_2 = null;
        /// <summary> 
        /// 月奖_部门_公关1级 
        /// </summary> 
        public System.Double? a_nMonthAward_Department_PublicRelations_1 = null;
        /// <summary> 
        /// 月奖_部门_公关2级 
        /// </summary> 
        public System.Double? a_nMonthAward_Department_PublicRelations_2 = null;
        /// <summary> 
        /// 业绩金额 
        /// </summary> 
        public System.Double? a_nAchievementMoney = null;
        /// <summary> 
        /// 签订金额 
        /// </summary> 
        public System.Double? a_nSignedMoney = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkOrderItem_Proportion( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_nTask_Employee != null) { mySqlScript += "nTask_Employee,"; }
            if (this.a_nTask_PublicRelations != null) { mySqlScript += "nTask_PublicRelations,"; }
            if (this.a_nCommission_Employee != null) { mySqlScript += "nCommission_Employee,"; }
            if (this.a_nCommission_PublicRelations != null) { mySqlScript += "nCommission_PublicRelations,"; }
            if (this.a_nCommission_Department_Employee_1 != null) { mySqlScript += "nCommission_Department_Employee_1,"; }
            if (this.a_nCommission_Department_Employee_2 != null) { mySqlScript += "nCommission_Department_Employee_2,"; }
            if (this.a_nCommission_Department_PublicRelations_1 != null) { mySqlScript += "nCommission_Department_PublicRelations_1,"; }
            if (this.a_nCommission_Department_PublicRelations_2 != null) { mySqlScript += "nCommission_Department_PublicRelations_2,"; }
            if (this.a_nTotalCommission_Employee != null) { mySqlScript += "nTotalCommission_Employee,"; }
            if (this.a_nYearAward_Employee != null) { mySqlScript += "nYearAward_Employee,"; }
            if (this.a_nYearAward_PublicRelations != null) { mySqlScript += "nYearAward_PublicRelations,"; }
            if (this.a_nYearAward_Department_Employee_1 != null) { mySqlScript += "nYearAward_Department_Employee_1,"; }
            if (this.a_nYearAward_Department_Employee_2 != null) { mySqlScript += "nYearAward_Department_Employee_2,"; }
            if (this.a_nYearAward_Department_PublicRelations_1 != null) { mySqlScript += "nYearAward_Department_PublicRelations_1,"; }
            if (this.a_nYearAward_Department_PublicRelations_2 != null) { mySqlScript += "nYearAward_Department_PublicRelations_2,"; }
            if (this.a_nQuarterAward_Employee != null) { mySqlScript += "nQuarterAward_Employee,"; }
            if (this.a_nQuarterAward_PublicRelations != null) { mySqlScript += "nQuarterAward_PublicRelations,"; }
            if (this.a_nQuarterAward_Department_Employee_1 != null) { mySqlScript += "nQuarterAward_Department_Employee_1,"; }
            if (this.a_nQuarterAward_Department_Employee_2 != null) { mySqlScript += "nQuarterAward_Department_Employee_2,"; }
            if (this.a_nQuarterAward_Department_PublicRelations_1 != null) { mySqlScript += "nQuarterAward_Department_PublicRelations_1,"; }
            if (this.a_nQuarterAward_Department_PublicRelations_2 != null) { mySqlScript += "nQuarterAward_Department_PublicRelations_2,"; }
            if (this.a_nMonthAward_Employee != null) { mySqlScript += "nMonthAward_Employee,"; }
            if (this.a_nMonthAward_PublicRelations != null) { mySqlScript += "nMonthAward_PublicRelations,"; }
            if (this.a_nMonthAward_Department_Employee_1 != null) { mySqlScript += "nMonthAward_Department_Employee_1,"; }
            if (this.a_nMonthAward_Department_Employee_2 != null) { mySqlScript += "nMonthAward_Department_Employee_2,"; }
            if (this.a_nMonthAward_Department_PublicRelations_1 != null) { mySqlScript += "nMonthAward_Department_PublicRelations_1,"; }
            if (this.a_nMonthAward_Department_PublicRelations_2 != null) { mySqlScript += "nMonthAward_Department_PublicRelations_2,"; }
            if (this.a_nAchievementMoney != null) { mySqlScript += "nAchievementMoney,"; }
            if (this.a_nSignedMoney != null) { mySqlScript += "nSignedMoney,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_nTask_Employee != null) { mySqlScript += this.a_nTask_Employee + ","; }
            if (this.a_nTask_PublicRelations != null) { mySqlScript += this.a_nTask_PublicRelations + ","; }
            if (this.a_nCommission_Employee != null) { mySqlScript += this.a_nCommission_Employee + ","; }
            if (this.a_nCommission_PublicRelations != null) { mySqlScript += this.a_nCommission_PublicRelations + ","; }
            if (this.a_nCommission_Department_Employee_1 != null) { mySqlScript += this.a_nCommission_Department_Employee_1 + ","; }
            if (this.a_nCommission_Department_Employee_2 != null) { mySqlScript += this.a_nCommission_Department_Employee_2 + ","; }
            if (this.a_nCommission_Department_PublicRelations_1 != null) { mySqlScript += this.a_nCommission_Department_PublicRelations_1 + ","; }
            if (this.a_nCommission_Department_PublicRelations_2 != null) { mySqlScript += this.a_nCommission_Department_PublicRelations_2 + ","; }
            if (this.a_nTotalCommission_Employee != null) { mySqlScript += this.a_nTotalCommission_Employee + ","; }
            if (this.a_nYearAward_Employee != null) { mySqlScript += this.a_nYearAward_Employee + ","; }
            if (this.a_nYearAward_PublicRelations != null) { mySqlScript += this.a_nYearAward_PublicRelations + ","; }
            if (this.a_nYearAward_Department_Employee_1 != null) { mySqlScript += this.a_nYearAward_Department_Employee_1 + ","; }
            if (this.a_nYearAward_Department_Employee_2 != null) { mySqlScript += this.a_nYearAward_Department_Employee_2 + ","; }
            if (this.a_nYearAward_Department_PublicRelations_1 != null) { mySqlScript += this.a_nYearAward_Department_PublicRelations_1 + ","; }
            if (this.a_nYearAward_Department_PublicRelations_2 != null) { mySqlScript += this.a_nYearAward_Department_PublicRelations_2 + ","; }
            if (this.a_nQuarterAward_Employee != null) { mySqlScript += this.a_nQuarterAward_Employee + ","; }
            if (this.a_nQuarterAward_PublicRelations != null) { mySqlScript += this.a_nQuarterAward_PublicRelations + ","; }
            if (this.a_nQuarterAward_Department_Employee_1 != null) { mySqlScript += this.a_nQuarterAward_Department_Employee_1 + ","; }
            if (this.a_nQuarterAward_Department_Employee_2 != null) { mySqlScript += this.a_nQuarterAward_Department_Employee_2 + ","; }
            if (this.a_nQuarterAward_Department_PublicRelations_1 != null) { mySqlScript += this.a_nQuarterAward_Department_PublicRelations_1 + ","; }
            if (this.a_nQuarterAward_Department_PublicRelations_2 != null) { mySqlScript += this.a_nQuarterAward_Department_PublicRelations_2 + ","; }
            if (this.a_nMonthAward_Employee != null) { mySqlScript += this.a_nMonthAward_Employee + ","; }
            if (this.a_nMonthAward_PublicRelations != null) { mySqlScript += this.a_nMonthAward_PublicRelations + ","; }
            if (this.a_nMonthAward_Department_Employee_1 != null) { mySqlScript += this.a_nMonthAward_Department_Employee_1 + ","; }
            if (this.a_nMonthAward_Department_Employee_2 != null) { mySqlScript += this.a_nMonthAward_Department_Employee_2 + ","; }
            if (this.a_nMonthAward_Department_PublicRelations_1 != null) { mySqlScript += this.a_nMonthAward_Department_PublicRelations_1 + ","; }
            if (this.a_nMonthAward_Department_PublicRelations_2 != null) { mySqlScript += this.a_nMonthAward_Department_PublicRelations_2 + ","; }
            if (this.a_nAchievementMoney != null) { mySqlScript += this.a_nAchievementMoney + ","; }
            if (this.a_nSignedMoney != null) { mySqlScript += this.a_nSignedMoney + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkOrderItem_Proportion set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_nTask_Employee != null) { iColumnCount++; mySqlScript += " nTask_Employee = " + this.a_nTask_Employee + ","; }
            if (this.a_nTask_PublicRelations != null) { iColumnCount++; mySqlScript += " nTask_PublicRelations = " + this.a_nTask_PublicRelations + ","; }
            if (this.a_nCommission_Employee != null) { iColumnCount++; mySqlScript += " nCommission_Employee = " + this.a_nCommission_Employee + ","; }
            if (this.a_nCommission_PublicRelations != null) { iColumnCount++; mySqlScript += " nCommission_PublicRelations = " + this.a_nCommission_PublicRelations + ","; }
            if (this.a_nCommission_Department_Employee_1 != null) { iColumnCount++; mySqlScript += " nCommission_Department_Employee_1 = " + this.a_nCommission_Department_Employee_1 + ","; }
            if (this.a_nCommission_Department_Employee_2 != null) { iColumnCount++; mySqlScript += " nCommission_Department_Employee_2 = " + this.a_nCommission_Department_Employee_2 + ","; }
            if (this.a_nCommission_Department_PublicRelations_1 != null) { iColumnCount++; mySqlScript += " nCommission_Department_PublicRelations_1 = " + this.a_nCommission_Department_PublicRelations_1 + ","; }
            if (this.a_nCommission_Department_PublicRelations_2 != null) { iColumnCount++; mySqlScript += " nCommission_Department_PublicRelations_2 = " + this.a_nCommission_Department_PublicRelations_2 + ","; }
            if (this.a_nTotalCommission_Employee != null) { iColumnCount++; mySqlScript += " nTotalCommission_Employee = " + this.a_nTotalCommission_Employee + ","; }
            if (this.a_nYearAward_Employee != null) { iColumnCount++; mySqlScript += " nYearAward_Employee = " + this.a_nYearAward_Employee + ","; }
            if (this.a_nYearAward_PublicRelations != null) { iColumnCount++; mySqlScript += " nYearAward_PublicRelations = " + this.a_nYearAward_PublicRelations + ","; }
            if (this.a_nYearAward_Department_Employee_1 != null) { iColumnCount++; mySqlScript += " nYearAward_Department_Employee_1 = " + this.a_nYearAward_Department_Employee_1 + ","; }
            if (this.a_nYearAward_Department_Employee_2 != null) { iColumnCount++; mySqlScript += " nYearAward_Department_Employee_2 = " + this.a_nYearAward_Department_Employee_2 + ","; }
            if (this.a_nYearAward_Department_PublicRelations_1 != null) { iColumnCount++; mySqlScript += " nYearAward_Department_PublicRelations_1 = " + this.a_nYearAward_Department_PublicRelations_1 + ","; }
            if (this.a_nYearAward_Department_PublicRelations_2 != null) { iColumnCount++; mySqlScript += " nYearAward_Department_PublicRelations_2 = " + this.a_nYearAward_Department_PublicRelations_2 + ","; }
            if (this.a_nQuarterAward_Employee != null) { iColumnCount++; mySqlScript += " nQuarterAward_Employee = " + this.a_nQuarterAward_Employee + ","; }
            if (this.a_nQuarterAward_PublicRelations != null) { iColumnCount++; mySqlScript += " nQuarterAward_PublicRelations = " + this.a_nQuarterAward_PublicRelations + ","; }
            if (this.a_nQuarterAward_Department_Employee_1 != null) { iColumnCount++; mySqlScript += " nQuarterAward_Department_Employee_1 = " + this.a_nQuarterAward_Department_Employee_1 + ","; }
            if (this.a_nQuarterAward_Department_Employee_2 != null) { iColumnCount++; mySqlScript += " nQuarterAward_Department_Employee_2 = " + this.a_nQuarterAward_Department_Employee_2 + ","; }
            if (this.a_nQuarterAward_Department_PublicRelations_1 != null) { iColumnCount++; mySqlScript += " nQuarterAward_Department_PublicRelations_1 = " + this.a_nQuarterAward_Department_PublicRelations_1 + ","; }
            if (this.a_nQuarterAward_Department_PublicRelations_2 != null) { iColumnCount++; mySqlScript += " nQuarterAward_Department_PublicRelations_2 = " + this.a_nQuarterAward_Department_PublicRelations_2 + ","; }
            if (this.a_nMonthAward_Employee != null) { iColumnCount++; mySqlScript += " nMonthAward_Employee = " + this.a_nMonthAward_Employee + ","; }
            if (this.a_nMonthAward_PublicRelations != null) { iColumnCount++; mySqlScript += " nMonthAward_PublicRelations = " + this.a_nMonthAward_PublicRelations + ","; }
            if (this.a_nMonthAward_Department_Employee_1 != null) { iColumnCount++; mySqlScript += " nMonthAward_Department_Employee_1 = " + this.a_nMonthAward_Department_Employee_1 + ","; }
            if (this.a_nMonthAward_Department_Employee_2 != null) { iColumnCount++; mySqlScript += " nMonthAward_Department_Employee_2 = " + this.a_nMonthAward_Department_Employee_2 + ","; }
            if (this.a_nMonthAward_Department_PublicRelations_1 != null) { iColumnCount++; mySqlScript += " nMonthAward_Department_PublicRelations_1 = " + this.a_nMonthAward_Department_PublicRelations_1 + ","; }
            if (this.a_nMonthAward_Department_PublicRelations_2 != null) { iColumnCount++; mySqlScript += " nMonthAward_Department_PublicRelations_2 = " + this.a_nMonthAward_Department_PublicRelations_2 + ","; }
            if (this.a_nAchievementMoney != null) { iColumnCount++; mySqlScript += " nAchievementMoney = " + this.a_nAchievementMoney + ","; }
            if (this.a_nSignedMoney != null) { iColumnCount++; mySqlScript += " nSignedMoney = " + this.a_nSignedMoney + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkOrderItem_Proportion Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //见报检测( WorkPublishDetection )  
    /// <summary>
    /// 见报检测
    /// </summary>
    public partial class Sql_WorkPublishDetection
    {
        #region 与数据表(见报检测)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 内容 
        /// </summary> 
        public System.String a_sContent = null;
        /// <summary> 
        /// 色彩ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Color = null;
        /// <summary> 
        /// 色彩 
        /// </summary> 
        public System.String a_sNameBasePrice_Color = null;
        /// <summary> 
        /// 规格ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_Specification = null;
        /// <summary> 
        /// 规格 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_Specification = null;
        /// <summary> 
        /// 版位类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 版位类别 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 刊出日期 
        /// </summary> 
        public System.DateTime? a_dIssueDate = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sContent != null) { this.a_sContent = ReplaceString.GetReplaceString(this.a_sContent); }
            if (this.a_sGuidBasePrice_Color != null) { this.a_sGuidBasePrice_Color = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Color); }
            if (this.a_sNameBasePrice_Color != null) { this.a_sNameBasePrice_Color = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Color); }
            if (this.a_sGuidBasePrice_Media_Specification != null) { this.a_sGuidBasePrice_Media_Specification = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_Specification); }
            if (this.a_sNameBasePrice_Media_Specification != null) { this.a_sNameBasePrice_Media_Specification = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_Specification); }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { this.a_sGuidBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_PagePositionType); }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { this.a_sNameBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_PagePositionType); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkPublishDetection( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sContent != null) { mySqlScript += "sContent,"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "sGuidBasePrice_Color,"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "sNameBasePrice_Color,"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { mySqlScript += "sGuidBasePrice_Media_Specification,"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { mySqlScript += "sNameBasePrice_Media_Specification,"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "sGuidBasePrice_Media_PagePositionType,"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "sNameBasePrice_Media_PagePositionType,"; }
            if (this.a_dIssueDate != null) { mySqlScript += "dIssueDate,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sContent != null) { mySqlScript += "'" + this.a_sContent + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "'" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_Specification + "',"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_Specification + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_dIssueDate != null) { mySqlScript += "'" + this.a_dIssueDate + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkPublishDetection set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sContent != null) { iColumnCount++; mySqlScript += " sContent = '" + this.a_sContent + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Color = '" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Color = '" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_Specification = '" + this.a_sGuidBasePrice_Media_Specification + "',"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_Specification = '" + this.a_sNameBasePrice_Media_Specification + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_PagePositionType = '" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_PagePositionType = '" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_dIssueDate != null) { iColumnCount++; mySqlScript += " dIssueDate = '" + this.a_dIssueDate + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkPublishDetection Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //欠款处罚结果( WorkPunishment_Arrears )  
    /// <summary>
    /// 欠款处罚结果
    /// </summary>
    public partial class Sql_WorkPunishment_Arrears
    {
        #region 与数据表(欠款处罚结果)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkPunishment_Arrears( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkPunishment_Arrears set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkPunishment_Arrears Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //预开发票处罚结果( WorkPunishment_PriorInvoice )  
    /// <summary>
    /// 预开发票处罚结果
    /// </summary>
    public partial class Sql_WorkPunishment_PriorInvoice
    {
        #region 与数据表(预开发票处罚结果)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkPunishment_PriorInvoice( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkPunishment_PriorInvoice set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkPunishment_PriorInvoice Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //佣金结果表(业务员)( WorkSalary_Commision_Employee )  
    /// <summary>
    /// 佣金结果表(业务员)
    /// </summary>
    public partial class Sql_WorkSalary_Commision_Employee
    {
        #region 与数据表(佣金结果表(业务员))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 收款ID 
        /// </summary> 
        public System.String a_sGuidWorkCharge = null;
        /// <summary> 
        /// 平帐ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem_Charge = null;
        /// <summary> 
        /// 部门ID1 
        /// </summary> 
        public System.String a_sGuidBase_Department_1 = null;
        /// <summary> 
        /// 部门ID2 
        /// </summary> 
        public System.String a_sGuidBase_Department_2 = null;
        /// <summary> 
        /// 部门ID3 
        /// </summary> 
        public System.String a_sGuidBase_Department_3 = null;
        /// <summary> 
        /// 部门1级 
        /// </summary> 
        public System.String a_sNameBase_Department_1 = null;
        /// <summary> 
        /// 部门2级 
        /// </summary> 
        public System.String a_sNameBase_Department_2 = null;
        /// <summary> 
        /// 部门3级 
        /// </summary> 
        public System.String a_sNameBase_Department_3 = null;
        /// <summary> 
        /// 业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Employee = null;
        /// <summary> 
        /// 业务员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Employee = null;
        /// <summary> 
        /// 政策ID 
        /// </summary> 
        public System.String a_sGuidBaseCommision_Policy_Employee = null;
        /// <summary> 
        /// 政策 
        /// </summary> 
        public System.String a_sNameBaseCommision_Policy_Employee = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 签订金额 
        /// </summary> 
        public System.Double? a_nSignedMoney = null;
        /// <summary> 
        /// 平帐额 
        /// </summary> 
        public System.Double? a_nClearArrearsMoney = null;
        /// <summary> 
        /// 收款方式比例 
        /// </summary> 
        public System.Double? a_nInfoBaseFinance_ReceiveMoneyMode_Proportion = null;
        /// <summary> 
        /// 归属百分比 
        /// </summary> 
        public System.Double? a_nWorkOrderItem_Percentage_Employee_Commission = null;
        /// <summary> 
        /// 业绩比例 
        /// </summary> 
        public System.Double? a_nWorkOrderItem_Percentage_Employee_Achievement = null;
        /// <summary> 
        /// 佣金比例 
        /// </summary> 
        public System.Double? a_nWorkOrderItem_Proportion_Commission = null;
        /// <summary> 
        /// 任务比例 
        /// </summary> 
        public System.Double? a_nWorkOrderItem_Proportion_Task = null;
        /// <summary> 
        /// 广告折扣 
        /// </summary> 
        public System.Double? a_nAdvertisementDiscount = null;
        /// <summary> 
        /// 任务 
        /// </summary> 
        public System.Double? a_nTask = null;
        /// <summary> 
        /// 任务调整额 
        /// </summary> 
        public System.Double? a_nAdjustment_Task = null;
        /// <summary> 
        /// 业绩 
        /// </summary> 
        public System.Double? a_nAchievement = null;
        /// <summary> 
        /// 业绩调整额 
        /// </summary> 
        public System.Double? a_nAdjustment_Achievement = null;
        /// <summary> 
        /// 佣金基数 
        /// </summary> 
        public System.Double? a_nCommissionBasisMoney = null;
        /// <summary> 
        /// 佣金提取比例 
        /// </summary> 
        public System.Double? a_nCommissionProportion = null;
        /// <summary> 
        /// 佣金金额 
        /// </summary> 
        public System.Double? a_nCommission = null;
        /// <summary> 
        /// 佣金调整额 
        /// </summary> 
        public System.Double? a_nAdjustment_Commission = null;
        /// <summary> 
        /// 佣金调整后金额 
        /// </summary> 
        public System.Double? a_nCommission_AfterAdjustment = null;
        /// <summary> 
        /// 计提日期 
        /// </summary> 
        public System.DateTime? a_dShouldCalculationDate = null;
        /// <summary> 
        /// 复核日期 
        /// </summary> 
        public System.DateTime? a_dReviewDate = null;
        /// <summary> 
        /// 撤消复核日期 
        /// </summary> 
        public System.DateTime? a_dCancelReviewDate = null;
        /// <summary> 
        /// 平帐日期 
        /// </summary> 
        public System.DateTime? a_dClearArrearsDate = null;
        /// <summary> 
        /// 见报日期 
        /// </summary> 
        public System.DateTime? a_dPublishDate = null;
        /// <summary> 
        /// 是否复核 
        /// </summary> 
        public System.Boolean? a_bReview = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sGuidWorkCharge != null) { this.a_sGuidWorkCharge = ReplaceString.GetReplaceString(this.a_sGuidWorkCharge); }
            if (this.a_sGuidWorkOrderItem_Charge != null) { this.a_sGuidWorkOrderItem_Charge = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem_Charge); }
            if (this.a_sGuidBase_Department_1 != null) { this.a_sGuidBase_Department_1 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_1); }
            if (this.a_sGuidBase_Department_2 != null) { this.a_sGuidBase_Department_2 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_2); }
            if (this.a_sGuidBase_Department_3 != null) { this.a_sGuidBase_Department_3 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_3); }
            if (this.a_sNameBase_Department_1 != null) { this.a_sNameBase_Department_1 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_1); }
            if (this.a_sNameBase_Department_2 != null) { this.a_sNameBase_Department_2 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_2); }
            if (this.a_sNameBase_Department_3 != null) { this.a_sNameBase_Department_3 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_3); }
            if (this.a_sGuidBase_Department_Person_Employee != null) { this.a_sGuidBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Employee); }
            if (this.a_sNameBase_Department_Person_Employee != null) { this.a_sNameBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Employee); }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { this.a_sGuidBaseCommision_Policy_Employee = ReplaceString.GetReplaceString(this.a_sGuidBaseCommision_Policy_Employee); }
            if (this.a_sNameBaseCommision_Policy_Employee != null) { this.a_sNameBaseCommision_Policy_Employee = ReplaceString.GetReplaceString(this.a_sNameBaseCommision_Policy_Employee); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkSalary_Commision_Employee( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_sGuidWorkCharge != null) { mySqlScript += "sGuidWorkCharge,"; }
            if (this.a_sGuidWorkOrderItem_Charge != null) { mySqlScript += "sGuidWorkOrderItem_Charge,"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "sGuidBase_Department_1,"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "sGuidBase_Department_2,"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "sGuidBase_Department_3,"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "sNameBase_Department_1,"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "sNameBase_Department_2,"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "sNameBase_Department_3,"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "sGuidBase_Department_Person_Employee,"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "sNameBase_Department_Person_Employee,"; }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { mySqlScript += "sGuidBaseCommision_Policy_Employee,"; }
            if (this.a_sNameBaseCommision_Policy_Employee != null) { mySqlScript += "sNameBaseCommision_Policy_Employee,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_nSignedMoney != null) { mySqlScript += "nSignedMoney,"; }
            if (this.a_nClearArrearsMoney != null) { mySqlScript += "nClearArrearsMoney,"; }
            if (this.a_nInfoBaseFinance_ReceiveMoneyMode_Proportion != null) { mySqlScript += "nInfoBaseFinance_ReceiveMoneyMode_Proportion,"; }
            if (this.a_nWorkOrderItem_Percentage_Employee_Commission != null) { mySqlScript += "nWorkOrderItem_Percentage_Employee_Commission,"; }
            if (this.a_nWorkOrderItem_Percentage_Employee_Achievement != null) { mySqlScript += "nWorkOrderItem_Percentage_Employee_Achievement,"; }
            if (this.a_nWorkOrderItem_Proportion_Commission != null) { mySqlScript += "nWorkOrderItem_Proportion_Commission,"; }
            if (this.a_nWorkOrderItem_Proportion_Task != null) { mySqlScript += "nWorkOrderItem_Proportion_Task,"; }
            if (this.a_nAdvertisementDiscount != null) { mySqlScript += "nAdvertisementDiscount,"; }
            if (this.a_nTask != null) { mySqlScript += "nTask,"; }
            if (this.a_nAdjustment_Task != null) { mySqlScript += "nAdjustment_Task,"; }
            if (this.a_nAchievement != null) { mySqlScript += "nAchievement,"; }
            if (this.a_nAdjustment_Achievement != null) { mySqlScript += "nAdjustment_Achievement,"; }
            if (this.a_nCommissionBasisMoney != null) { mySqlScript += "nCommissionBasisMoney,"; }
            if (this.a_nCommissionProportion != null) { mySqlScript += "nCommissionProportion,"; }
            if (this.a_nCommission != null) { mySqlScript += "nCommission,"; }
            if (this.a_nAdjustment_Commission != null) { mySqlScript += "nAdjustment_Commission,"; }
            if (this.a_nCommission_AfterAdjustment != null) { mySqlScript += "nCommission_AfterAdjustment,"; }
            if (this.a_dShouldCalculationDate != null) { mySqlScript += "dShouldCalculationDate,"; }
            if (this.a_dReviewDate != null) { mySqlScript += "dReviewDate,"; }
            if (this.a_dCancelReviewDate != null) { mySqlScript += "dCancelReviewDate,"; }
            if (this.a_dClearArrearsDate != null) { mySqlScript += "dClearArrearsDate,"; }
            if (this.a_dPublishDate != null) { mySqlScript += "dPublishDate,"; }
            if (this.a_bReview != null) { mySqlScript += "bReview,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sGuidWorkCharge != null) { mySqlScript += "'" + this.a_sGuidWorkCharge + "',"; }
            if (this.a_sGuidWorkOrderItem_Charge != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem_Charge + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "'" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "'" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "'" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { mySqlScript += "'" + this.a_sGuidBaseCommision_Policy_Employee + "',"; }
            if (this.a_sNameBaseCommision_Policy_Employee != null) { mySqlScript += "'" + this.a_sNameBaseCommision_Policy_Employee + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_nSignedMoney != null) { mySqlScript += this.a_nSignedMoney + ","; }
            if (this.a_nClearArrearsMoney != null) { mySqlScript += this.a_nClearArrearsMoney + ","; }
            if (this.a_nInfoBaseFinance_ReceiveMoneyMode_Proportion != null) { mySqlScript += this.a_nInfoBaseFinance_ReceiveMoneyMode_Proportion + ","; }
            if (this.a_nWorkOrderItem_Percentage_Employee_Commission != null) { mySqlScript += this.a_nWorkOrderItem_Percentage_Employee_Commission + ","; }
            if (this.a_nWorkOrderItem_Percentage_Employee_Achievement != null) { mySqlScript += this.a_nWorkOrderItem_Percentage_Employee_Achievement + ","; }
            if (this.a_nWorkOrderItem_Proportion_Commission != null) { mySqlScript += this.a_nWorkOrderItem_Proportion_Commission + ","; }
            if (this.a_nWorkOrderItem_Proportion_Task != null) { mySqlScript += this.a_nWorkOrderItem_Proportion_Task + ","; }
            if (this.a_nAdvertisementDiscount != null) { mySqlScript += this.a_nAdvertisementDiscount + ","; }
            if (this.a_nTask != null) { mySqlScript += this.a_nTask + ","; }
            if (this.a_nAdjustment_Task != null) { mySqlScript += this.a_nAdjustment_Task + ","; }
            if (this.a_nAchievement != null) { mySqlScript += this.a_nAchievement + ","; }
            if (this.a_nAdjustment_Achievement != null) { mySqlScript += this.a_nAdjustment_Achievement + ","; }
            if (this.a_nCommissionBasisMoney != null) { mySqlScript += this.a_nCommissionBasisMoney + ","; }
            if (this.a_nCommissionProportion != null) { mySqlScript += this.a_nCommissionProportion + ","; }
            if (this.a_nCommission != null) { mySqlScript += this.a_nCommission + ","; }
            if (this.a_nAdjustment_Commission != null) { mySqlScript += this.a_nAdjustment_Commission + ","; }
            if (this.a_nCommission_AfterAdjustment != null) { mySqlScript += this.a_nCommission_AfterAdjustment + ","; }
            if (this.a_dShouldCalculationDate != null) { mySqlScript += "'" + this.a_dShouldCalculationDate + "',"; }
            if (this.a_dReviewDate != null) { mySqlScript += "'" + this.a_dReviewDate + "',"; }
            if (this.a_dCancelReviewDate != null) { mySqlScript += "'" + this.a_dCancelReviewDate + "',"; }
            if (this.a_dClearArrearsDate != null) { mySqlScript += "'" + this.a_dClearArrearsDate + "',"; }
            if (this.a_dPublishDate != null) { mySqlScript += "'" + this.a_dPublishDate + "',"; }
            if (this.a_bReview != null) { mySqlScript += "'" + this.a_bReview + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkSalary_Commision_Employee set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sGuidWorkCharge != null) { iColumnCount++; mySqlScript += " sGuidWorkCharge = '" + this.a_sGuidWorkCharge + "',"; }
            if (this.a_sGuidWorkOrderItem_Charge != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem_Charge = '" + this.a_sGuidWorkOrderItem_Charge + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_1 = '" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_2 = '" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_3 = '" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_sNameBase_Department_1 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_1 = '" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_2 = '" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_3 = '" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Employee = '" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Employee = '" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_sGuidBaseCommision_Policy_Employee != null) { iColumnCount++; mySqlScript += " sGuidBaseCommision_Policy_Employee = '" + this.a_sGuidBaseCommision_Policy_Employee + "',"; }
            if (this.a_sNameBaseCommision_Policy_Employee != null) { iColumnCount++; mySqlScript += " sNameBaseCommision_Policy_Employee = '" + this.a_sNameBaseCommision_Policy_Employee + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_nSignedMoney != null) { iColumnCount++; mySqlScript += " nSignedMoney = " + this.a_nSignedMoney + ","; }
            if (this.a_nClearArrearsMoney != null) { iColumnCount++; mySqlScript += " nClearArrearsMoney = " + this.a_nClearArrearsMoney + ","; }
            if (this.a_nInfoBaseFinance_ReceiveMoneyMode_Proportion != null) { iColumnCount++; mySqlScript += " nInfoBaseFinance_ReceiveMoneyMode_Proportion = " + this.a_nInfoBaseFinance_ReceiveMoneyMode_Proportion + ","; }
            if (this.a_nWorkOrderItem_Percentage_Employee_Commission != null) { iColumnCount++; mySqlScript += " nWorkOrderItem_Percentage_Employee_Commission = " + this.a_nWorkOrderItem_Percentage_Employee_Commission + ","; }
            if (this.a_nWorkOrderItem_Percentage_Employee_Achievement != null) { iColumnCount++; mySqlScript += " nWorkOrderItem_Percentage_Employee_Achievement = " + this.a_nWorkOrderItem_Percentage_Employee_Achievement + ","; }
            if (this.a_nWorkOrderItem_Proportion_Commission != null) { iColumnCount++; mySqlScript += " nWorkOrderItem_Proportion_Commission = " + this.a_nWorkOrderItem_Proportion_Commission + ","; }
            if (this.a_nWorkOrderItem_Proportion_Task != null) { iColumnCount++; mySqlScript += " nWorkOrderItem_Proportion_Task = " + this.a_nWorkOrderItem_Proportion_Task + ","; }
            if (this.a_nAdvertisementDiscount != null) { iColumnCount++; mySqlScript += " nAdvertisementDiscount = " + this.a_nAdvertisementDiscount + ","; }
            if (this.a_nTask != null) { iColumnCount++; mySqlScript += " nTask = " + this.a_nTask + ","; }
            if (this.a_nAdjustment_Task != null) { iColumnCount++; mySqlScript += " nAdjustment_Task = " + this.a_nAdjustment_Task + ","; }
            if (this.a_nAchievement != null) { iColumnCount++; mySqlScript += " nAchievement = " + this.a_nAchievement + ","; }
            if (this.a_nAdjustment_Achievement != null) { iColumnCount++; mySqlScript += " nAdjustment_Achievement = " + this.a_nAdjustment_Achievement + ","; }
            if (this.a_nCommissionBasisMoney != null) { iColumnCount++; mySqlScript += " nCommissionBasisMoney = " + this.a_nCommissionBasisMoney + ","; }
            if (this.a_nCommissionProportion != null) { iColumnCount++; mySqlScript += " nCommissionProportion = " + this.a_nCommissionProportion + ","; }
            if (this.a_nCommission != null) { iColumnCount++; mySqlScript += " nCommission = " + this.a_nCommission + ","; }
            if (this.a_nAdjustment_Commission != null) { iColumnCount++; mySqlScript += " nAdjustment_Commission = " + this.a_nAdjustment_Commission + ","; }
            if (this.a_nCommission_AfterAdjustment != null) { iColumnCount++; mySqlScript += " nCommission_AfterAdjustment = " + this.a_nCommission_AfterAdjustment + ","; }
            if (this.a_dShouldCalculationDate != null) { iColumnCount++; mySqlScript += " dShouldCalculationDate = '" + this.a_dShouldCalculationDate + "',"; }
            if (this.a_dReviewDate != null) { iColumnCount++; mySqlScript += " dReviewDate = '" + this.a_dReviewDate + "',"; }
            if (this.a_dCancelReviewDate != null) { iColumnCount++; mySqlScript += " dCancelReviewDate = '" + this.a_dCancelReviewDate + "',"; }
            if (this.a_dClearArrearsDate != null) { iColumnCount++; mySqlScript += " dClearArrearsDate = '" + this.a_dClearArrearsDate + "',"; }
            if (this.a_dPublishDate != null) { iColumnCount++; mySqlScript += " dPublishDate = '" + this.a_dPublishDate + "',"; }
            if (this.a_bReview != null) { iColumnCount++; mySqlScript += " bReview = '" + this.a_bReview + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkSalary_Commision_Employee Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //年奖/季奖/月奖/部门计提(业务员)( WorkSalary_Commision_Employee_Award )  
    /// <summary>
    /// 年奖/季奖/月奖/部门计提(业务员)
    /// </summary>
    public partial class Sql_WorkSalary_Commision_Employee_Award
    {
        #region 与数据表(年奖/季奖/月奖/部门计提(业务员))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 佣金ID 
        /// </summary> 
        public System.String a_sGuidWorkSalary_Commision_Employee = null;
        /// <summary> 
        /// 业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Employee = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 业务员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Employee = null;
        /// <summary> 
        /// 年奖比例_业务员 
        /// </summary> 
        public System.Double? a_nProportion_YearAward_Employee = null;
        /// <summary> 
        /// 年奖调整额_业务员 
        /// </summary> 
        public System.Double? a_nAdjustment_YearAward_Employee = null;
        /// <summary> 
        /// 年奖比例_部门1级 
        /// </summary> 
        public System.Double? a_nProportion_YearAward_Departments_1 = null;
        /// <summary> 
        /// 年奖调整额_部门1级 
        /// </summary> 
        public System.Double? a_nAdjustment_YearAward_Departments_1 = null;
        /// <summary> 
        /// 年奖比例_部门2级 
        /// </summary> 
        public System.Double? a_nProportion_YearAward_Departments_2 = null;
        /// <summary> 
        /// 年奖调整额_部门2级 
        /// </summary> 
        public System.Double? a_nAdjustment_YearAward_Departments_2 = null;
        /// <summary> 
        /// 年奖比例_部门3级 
        /// </summary> 
        public System.Double? a_nProportion_YearAward_Departments_3 = null;
        /// <summary> 
        /// 年奖调整额_部门3级 
        /// </summary> 
        public System.Double? a_nAdjustment_YearAward_Departments_3 = null;
        /// <summary> 
        /// 部门计提比例_部门1级 
        /// </summary> 
        public System.Double? a_nProportion_DepartmentCalculation_Departments_1 = null;
        /// <summary> 
        /// 部门计提调整额_部门1级 
        /// </summary> 
        public System.Double? a_nAdjustment_DepartmentCalculation_Departments_1 = null;
        /// <summary> 
        /// 部门计提比例_部门2级 
        /// </summary> 
        public System.Double? a_nProportion_DepartmentCalculation_Departments_2 = null;
        /// <summary> 
        /// 部门计提调整额_部门2级 
        /// </summary> 
        public System.Double? a_nAdjustment_DepartmentCalculation_Departments_2 = null;
        /// <summary> 
        /// 部门计提比例_部门3级 
        /// </summary> 
        public System.Double? a_nProportion_DepartmentCalculation_Departments_3 = null;
        /// <summary> 
        /// 部门计提调整额_部门3级 
        /// </summary> 
        public System.Double? a_nAdjustment_DepartmentCalculation_Departments_3 = null;
        /// <summary> 
        /// 季奖比例_业务员 
        /// </summary> 
        public System.Double? a_nProportion_QuarterAward_Employee = null;
        /// <summary> 
        /// 季奖调整额_业务员 
        /// </summary> 
        public System.Double? a_nAdjustment_QuarterAward_Employee = null;
        /// <summary> 
        /// 季奖比例_部门1级 
        /// </summary> 
        public System.Double? a_nProportion_QuarterAward_Departments_1 = null;
        /// <summary> 
        /// 季奖调整额_部门1级 
        /// </summary> 
        public System.Double? a_nAdjustment_QuarterAward_Departments_1 = null;
        /// <summary> 
        /// 季奖比例_部门2级 
        /// </summary> 
        public System.Double? a_nProportion_QuarterAward_Departments_2 = null;
        /// <summary> 
        /// 季奖调整额_部门2级 
        /// </summary> 
        public System.Double? a_nAdjustment_QuarterAward_Departments_2 = null;
        /// <summary> 
        /// 季奖比例_部门3级 
        /// </summary> 
        public System.Double? a_nProportion_QuarterAward_Departments_3 = null;
        /// <summary> 
        /// 季奖调整额_部门3级 
        /// </summary> 
        public System.Double? a_nAdjustment_QuarterAward_Departments_3 = null;
        /// <summary> 
        /// 月奖比例_业务员 
        /// </summary> 
        public System.Double? a_nProportion_MonthAward_Employee = null;
        /// <summary> 
        /// 月奖调整额_业务员 
        /// </summary> 
        public System.Double? a_nAdjustment_MonthAward_Employee = null;
        /// <summary> 
        /// 月奖比例_部门1级 
        /// </summary> 
        public System.Double? a_nProportion_MonthAward_Departments_1 = null;
        /// <summary> 
        /// 月奖调整额_部门1级 
        /// </summary> 
        public System.Double? a_nAdjustment_MonthAward_Departments_1 = null;
        /// <summary> 
        /// 月奖比例_部门2级 
        /// </summary> 
        public System.Double? a_nProportion_MonthAward_Departments_2 = null;
        /// <summary> 
        /// 月奖调整额_部门2级 
        /// </summary> 
        public System.Double? a_nAdjustment_MonthAward_Departments_2 = null;
        /// <summary> 
        /// 月奖比例_部门3级 
        /// </summary> 
        public System.Double? a_nProportion_MonthAward_Departments_3 = null;
        /// <summary> 
        /// 月奖调整额_部门3级 
        /// </summary> 
        public System.Double? a_nAdjustment_MonthAward_Departments_3 = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkSalary_Commision_Employee != null) { this.a_sGuidWorkSalary_Commision_Employee = ReplaceString.GetReplaceString(this.a_sGuidWorkSalary_Commision_Employee); }
            if (this.a_sGuidBase_Department_Person_Employee != null) { this.a_sGuidBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Employee); }
            if (this.a_sNameBase_Department_Person_Employee != null) { this.a_sNameBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Employee); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkSalary_Commision_Employee_Award( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkSalary_Commision_Employee != null) { mySqlScript += "sGuidWorkSalary_Commision_Employee,"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "sGuidBase_Department_Person_Employee,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "sNameBase_Department_Person_Employee,"; }
            if (this.a_nProportion_YearAward_Employee != null) { mySqlScript += "nProportion_YearAward_Employee,"; }
            if (this.a_nAdjustment_YearAward_Employee != null) { mySqlScript += "nAdjustment_YearAward_Employee,"; }
            if (this.a_nProportion_YearAward_Departments_1 != null) { mySqlScript += "nProportion_YearAward_Departments_1,"; }
            if (this.a_nAdjustment_YearAward_Departments_1 != null) { mySqlScript += "nAdjustment_YearAward_Departments_1,"; }
            if (this.a_nProportion_YearAward_Departments_2 != null) { mySqlScript += "nProportion_YearAward_Departments_2,"; }
            if (this.a_nAdjustment_YearAward_Departments_2 != null) { mySqlScript += "nAdjustment_YearAward_Departments_2,"; }
            if (this.a_nProportion_YearAward_Departments_3 != null) { mySqlScript += "nProportion_YearAward_Departments_3,"; }
            if (this.a_nAdjustment_YearAward_Departments_3 != null) { mySqlScript += "nAdjustment_YearAward_Departments_3,"; }
            if (this.a_nProportion_DepartmentCalculation_Departments_1 != null) { mySqlScript += "nProportion_DepartmentCalculation_Departments_1,"; }
            if (this.a_nAdjustment_DepartmentCalculation_Departments_1 != null) { mySqlScript += "nAdjustment_DepartmentCalculation_Departments_1,"; }
            if (this.a_nProportion_DepartmentCalculation_Departments_2 != null) { mySqlScript += "nProportion_DepartmentCalculation_Departments_2,"; }
            if (this.a_nAdjustment_DepartmentCalculation_Departments_2 != null) { mySqlScript += "nAdjustment_DepartmentCalculation_Departments_2,"; }
            if (this.a_nProportion_DepartmentCalculation_Departments_3 != null) { mySqlScript += "nProportion_DepartmentCalculation_Departments_3,"; }
            if (this.a_nAdjustment_DepartmentCalculation_Departments_3 != null) { mySqlScript += "nAdjustment_DepartmentCalculation_Departments_3,"; }
            if (this.a_nProportion_QuarterAward_Employee != null) { mySqlScript += "nProportion_QuarterAward_Employee,"; }
            if (this.a_nAdjustment_QuarterAward_Employee != null) { mySqlScript += "nAdjustment_QuarterAward_Employee,"; }
            if (this.a_nProportion_QuarterAward_Departments_1 != null) { mySqlScript += "nProportion_QuarterAward_Departments_1,"; }
            if (this.a_nAdjustment_QuarterAward_Departments_1 != null) { mySqlScript += "nAdjustment_QuarterAward_Departments_1,"; }
            if (this.a_nProportion_QuarterAward_Departments_2 != null) { mySqlScript += "nProportion_QuarterAward_Departments_2,"; }
            if (this.a_nAdjustment_QuarterAward_Departments_2 != null) { mySqlScript += "nAdjustment_QuarterAward_Departments_2,"; }
            if (this.a_nProportion_QuarterAward_Departments_3 != null) { mySqlScript += "nProportion_QuarterAward_Departments_3,"; }
            if (this.a_nAdjustment_QuarterAward_Departments_3 != null) { mySqlScript += "nAdjustment_QuarterAward_Departments_3,"; }
            if (this.a_nProportion_MonthAward_Employee != null) { mySqlScript += "nProportion_MonthAward_Employee,"; }
            if (this.a_nAdjustment_MonthAward_Employee != null) { mySqlScript += "nAdjustment_MonthAward_Employee,"; }
            if (this.a_nProportion_MonthAward_Departments_1 != null) { mySqlScript += "nProportion_MonthAward_Departments_1,"; }
            if (this.a_nAdjustment_MonthAward_Departments_1 != null) { mySqlScript += "nAdjustment_MonthAward_Departments_1,"; }
            if (this.a_nProportion_MonthAward_Departments_2 != null) { mySqlScript += "nProportion_MonthAward_Departments_2,"; }
            if (this.a_nAdjustment_MonthAward_Departments_2 != null) { mySqlScript += "nAdjustment_MonthAward_Departments_2,"; }
            if (this.a_nProportion_MonthAward_Departments_3 != null) { mySqlScript += "nProportion_MonthAward_Departments_3,"; }
            if (this.a_nAdjustment_MonthAward_Departments_3 != null) { mySqlScript += "nAdjustment_MonthAward_Departments_3,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkSalary_Commision_Employee != null) { mySqlScript += "'" + this.a_sGuidWorkSalary_Commision_Employee + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_nProportion_YearAward_Employee != null) { mySqlScript += this.a_nProportion_YearAward_Employee + ","; }
            if (this.a_nAdjustment_YearAward_Employee != null) { mySqlScript += this.a_nAdjustment_YearAward_Employee + ","; }
            if (this.a_nProportion_YearAward_Departments_1 != null) { mySqlScript += this.a_nProportion_YearAward_Departments_1 + ","; }
            if (this.a_nAdjustment_YearAward_Departments_1 != null) { mySqlScript += this.a_nAdjustment_YearAward_Departments_1 + ","; }
            if (this.a_nProportion_YearAward_Departments_2 != null) { mySqlScript += this.a_nProportion_YearAward_Departments_2 + ","; }
            if (this.a_nAdjustment_YearAward_Departments_2 != null) { mySqlScript += this.a_nAdjustment_YearAward_Departments_2 + ","; }
            if (this.a_nProportion_YearAward_Departments_3 != null) { mySqlScript += this.a_nProportion_YearAward_Departments_3 + ","; }
            if (this.a_nAdjustment_YearAward_Departments_3 != null) { mySqlScript += this.a_nAdjustment_YearAward_Departments_3 + ","; }
            if (this.a_nProportion_DepartmentCalculation_Departments_1 != null) { mySqlScript += this.a_nProportion_DepartmentCalculation_Departments_1 + ","; }
            if (this.a_nAdjustment_DepartmentCalculation_Departments_1 != null) { mySqlScript += this.a_nAdjustment_DepartmentCalculation_Departments_1 + ","; }
            if (this.a_nProportion_DepartmentCalculation_Departments_2 != null) { mySqlScript += this.a_nProportion_DepartmentCalculation_Departments_2 + ","; }
            if (this.a_nAdjustment_DepartmentCalculation_Departments_2 != null) { mySqlScript += this.a_nAdjustment_DepartmentCalculation_Departments_2 + ","; }
            if (this.a_nProportion_DepartmentCalculation_Departments_3 != null) { mySqlScript += this.a_nProportion_DepartmentCalculation_Departments_3 + ","; }
            if (this.a_nAdjustment_DepartmentCalculation_Departments_3 != null) { mySqlScript += this.a_nAdjustment_DepartmentCalculation_Departments_3 + ","; }
            if (this.a_nProportion_QuarterAward_Employee != null) { mySqlScript += this.a_nProportion_QuarterAward_Employee + ","; }
            if (this.a_nAdjustment_QuarterAward_Employee != null) { mySqlScript += this.a_nAdjustment_QuarterAward_Employee + ","; }
            if (this.a_nProportion_QuarterAward_Departments_1 != null) { mySqlScript += this.a_nProportion_QuarterAward_Departments_1 + ","; }
            if (this.a_nAdjustment_QuarterAward_Departments_1 != null) { mySqlScript += this.a_nAdjustment_QuarterAward_Departments_1 + ","; }
            if (this.a_nProportion_QuarterAward_Departments_2 != null) { mySqlScript += this.a_nProportion_QuarterAward_Departments_2 + ","; }
            if (this.a_nAdjustment_QuarterAward_Departments_2 != null) { mySqlScript += this.a_nAdjustment_QuarterAward_Departments_2 + ","; }
            if (this.a_nProportion_QuarterAward_Departments_3 != null) { mySqlScript += this.a_nProportion_QuarterAward_Departments_3 + ","; }
            if (this.a_nAdjustment_QuarterAward_Departments_3 != null) { mySqlScript += this.a_nAdjustment_QuarterAward_Departments_3 + ","; }
            if (this.a_nProportion_MonthAward_Employee != null) { mySqlScript += this.a_nProportion_MonthAward_Employee + ","; }
            if (this.a_nAdjustment_MonthAward_Employee != null) { mySqlScript += this.a_nAdjustment_MonthAward_Employee + ","; }
            if (this.a_nProportion_MonthAward_Departments_1 != null) { mySqlScript += this.a_nProportion_MonthAward_Departments_1 + ","; }
            if (this.a_nAdjustment_MonthAward_Departments_1 != null) { mySqlScript += this.a_nAdjustment_MonthAward_Departments_1 + ","; }
            if (this.a_nProportion_MonthAward_Departments_2 != null) { mySqlScript += this.a_nProportion_MonthAward_Departments_2 + ","; }
            if (this.a_nAdjustment_MonthAward_Departments_2 != null) { mySqlScript += this.a_nAdjustment_MonthAward_Departments_2 + ","; }
            if (this.a_nProportion_MonthAward_Departments_3 != null) { mySqlScript += this.a_nProportion_MonthAward_Departments_3 + ","; }
            if (this.a_nAdjustment_MonthAward_Departments_3 != null) { mySqlScript += this.a_nAdjustment_MonthAward_Departments_3 + ","; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkSalary_Commision_Employee_Award set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkSalary_Commision_Employee != null) { iColumnCount++; mySqlScript += " sGuidWorkSalary_Commision_Employee = '" + this.a_sGuidWorkSalary_Commision_Employee + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Employee = '" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Employee = '" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_nProportion_YearAward_Employee != null) { iColumnCount++; mySqlScript += " nProportion_YearAward_Employee = " + this.a_nProportion_YearAward_Employee + ","; }
            if (this.a_nAdjustment_YearAward_Employee != null) { iColumnCount++; mySqlScript += " nAdjustment_YearAward_Employee = " + this.a_nAdjustment_YearAward_Employee + ","; }
            if (this.a_nProportion_YearAward_Departments_1 != null) { iColumnCount++; mySqlScript += " nProportion_YearAward_Departments_1 = " + this.a_nProportion_YearAward_Departments_1 + ","; }
            if (this.a_nAdjustment_YearAward_Departments_1 != null) { iColumnCount++; mySqlScript += " nAdjustment_YearAward_Departments_1 = " + this.a_nAdjustment_YearAward_Departments_1 + ","; }
            if (this.a_nProportion_YearAward_Departments_2 != null) { iColumnCount++; mySqlScript += " nProportion_YearAward_Departments_2 = " + this.a_nProportion_YearAward_Departments_2 + ","; }
            if (this.a_nAdjustment_YearAward_Departments_2 != null) { iColumnCount++; mySqlScript += " nAdjustment_YearAward_Departments_2 = " + this.a_nAdjustment_YearAward_Departments_2 + ","; }
            if (this.a_nProportion_YearAward_Departments_3 != null) { iColumnCount++; mySqlScript += " nProportion_YearAward_Departments_3 = " + this.a_nProportion_YearAward_Departments_3 + ","; }
            if (this.a_nAdjustment_YearAward_Departments_3 != null) { iColumnCount++; mySqlScript += " nAdjustment_YearAward_Departments_3 = " + this.a_nAdjustment_YearAward_Departments_3 + ","; }
            if (this.a_nProportion_DepartmentCalculation_Departments_1 != null) { iColumnCount++; mySqlScript += " nProportion_DepartmentCalculation_Departments_1 = " + this.a_nProportion_DepartmentCalculation_Departments_1 + ","; }
            if (this.a_nAdjustment_DepartmentCalculation_Departments_1 != null) { iColumnCount++; mySqlScript += " nAdjustment_DepartmentCalculation_Departments_1 = " + this.a_nAdjustment_DepartmentCalculation_Departments_1 + ","; }
            if (this.a_nProportion_DepartmentCalculation_Departments_2 != null) { iColumnCount++; mySqlScript += " nProportion_DepartmentCalculation_Departments_2 = " + this.a_nProportion_DepartmentCalculation_Departments_2 + ","; }
            if (this.a_nAdjustment_DepartmentCalculation_Departments_2 != null) { iColumnCount++; mySqlScript += " nAdjustment_DepartmentCalculation_Departments_2 = " + this.a_nAdjustment_DepartmentCalculation_Departments_2 + ","; }
            if (this.a_nProportion_DepartmentCalculation_Departments_3 != null) { iColumnCount++; mySqlScript += " nProportion_DepartmentCalculation_Departments_3 = " + this.a_nProportion_DepartmentCalculation_Departments_3 + ","; }
            if (this.a_nAdjustment_DepartmentCalculation_Departments_3 != null) { iColumnCount++; mySqlScript += " nAdjustment_DepartmentCalculation_Departments_3 = " + this.a_nAdjustment_DepartmentCalculation_Departments_3 + ","; }
            if (this.a_nProportion_QuarterAward_Employee != null) { iColumnCount++; mySqlScript += " nProportion_QuarterAward_Employee = " + this.a_nProportion_QuarterAward_Employee + ","; }
            if (this.a_nAdjustment_QuarterAward_Employee != null) { iColumnCount++; mySqlScript += " nAdjustment_QuarterAward_Employee = " + this.a_nAdjustment_QuarterAward_Employee + ","; }
            if (this.a_nProportion_QuarterAward_Departments_1 != null) { iColumnCount++; mySqlScript += " nProportion_QuarterAward_Departments_1 = " + this.a_nProportion_QuarterAward_Departments_1 + ","; }
            if (this.a_nAdjustment_QuarterAward_Departments_1 != null) { iColumnCount++; mySqlScript += " nAdjustment_QuarterAward_Departments_1 = " + this.a_nAdjustment_QuarterAward_Departments_1 + ","; }
            if (this.a_nProportion_QuarterAward_Departments_2 != null) { iColumnCount++; mySqlScript += " nProportion_QuarterAward_Departments_2 = " + this.a_nProportion_QuarterAward_Departments_2 + ","; }
            if (this.a_nAdjustment_QuarterAward_Departments_2 != null) { iColumnCount++; mySqlScript += " nAdjustment_QuarterAward_Departments_2 = " + this.a_nAdjustment_QuarterAward_Departments_2 + ","; }
            if (this.a_nProportion_QuarterAward_Departments_3 != null) { iColumnCount++; mySqlScript += " nProportion_QuarterAward_Departments_3 = " + this.a_nProportion_QuarterAward_Departments_3 + ","; }
            if (this.a_nAdjustment_QuarterAward_Departments_3 != null) { iColumnCount++; mySqlScript += " nAdjustment_QuarterAward_Departments_3 = " + this.a_nAdjustment_QuarterAward_Departments_3 + ","; }
            if (this.a_nProportion_MonthAward_Employee != null) { iColumnCount++; mySqlScript += " nProportion_MonthAward_Employee = " + this.a_nProportion_MonthAward_Employee + ","; }
            if (this.a_nAdjustment_MonthAward_Employee != null) { iColumnCount++; mySqlScript += " nAdjustment_MonthAward_Employee = " + this.a_nAdjustment_MonthAward_Employee + ","; }
            if (this.a_nProportion_MonthAward_Departments_1 != null) { iColumnCount++; mySqlScript += " nProportion_MonthAward_Departments_1 = " + this.a_nProportion_MonthAward_Departments_1 + ","; }
            if (this.a_nAdjustment_MonthAward_Departments_1 != null) { iColumnCount++; mySqlScript += " nAdjustment_MonthAward_Departments_1 = " + this.a_nAdjustment_MonthAward_Departments_1 + ","; }
            if (this.a_nProportion_MonthAward_Departments_2 != null) { iColumnCount++; mySqlScript += " nProportion_MonthAward_Departments_2 = " + this.a_nProportion_MonthAward_Departments_2 + ","; }
            if (this.a_nAdjustment_MonthAward_Departments_2 != null) { iColumnCount++; mySqlScript += " nAdjustment_MonthAward_Departments_2 = " + this.a_nAdjustment_MonthAward_Departments_2 + ","; }
            if (this.a_nProportion_MonthAward_Departments_3 != null) { iColumnCount++; mySqlScript += " nProportion_MonthAward_Departments_3 = " + this.a_nProportion_MonthAward_Departments_3 + ","; }
            if (this.a_nAdjustment_MonthAward_Departments_3 != null) { iColumnCount++; mySqlScript += " nAdjustment_MonthAward_Departments_3 = " + this.a_nAdjustment_MonthAward_Departments_3 + ","; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkSalary_Commision_Employee_Award Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //佣金结果表(公关人)( WorkSalary_Commision_PublicRelations )  
    /// <summary>
    /// 佣金结果表(公关人)
    /// </summary>
    public partial class Sql_WorkSalary_Commision_PublicRelations
    {
        #region 与数据表(佣金结果表(公关人))对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 收款ID 
        /// </summary> 
        public System.String a_sGuidWorkCharge = null;
        /// <summary> 
        /// 平帐ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem_Charge = null;
        /// <summary> 
        /// 部门ID1 
        /// </summary> 
        public System.String a_sGuidBase_Department_1 = null;
        /// <summary> 
        /// 部门ID2 
        /// </summary> 
        public System.String a_sGuidBase_Department_2 = null;
        /// <summary> 
        /// 部门ID3 
        /// </summary> 
        public System.String a_sGuidBase_Department_3 = null;
        /// <summary> 
        /// 部门1级 
        /// </summary> 
        public System.String a_sNameBase_Department_1 = null;
        /// <summary> 
        /// 部门2级 
        /// </summary> 
        public System.String a_sNameBase_Department_2 = null;
        /// <summary> 
        /// 部门3级 
        /// </summary> 
        public System.String a_sNameBase_Department_3 = null;
        /// <summary> 
        /// 业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_PublicRelations = null;
        /// <summary> 
        /// 业务员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_PublicRelations = null;
        /// <summary> 
        /// 政策ID 
        /// </summary> 
        public System.String a_sGuidBaseCommision_Policy_PublicRelations = null;
        /// <summary> 
        /// 政策 
        /// </summary> 
        public System.String a_sNameBaseCommision_Policy_PublicRelations = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 签订金额 
        /// </summary> 
        public System.Double? a_nSignedMoney = null;
        /// <summary> 
        /// 平帐额 
        /// </summary> 
        public System.Double? a_nClearArrearsMoney = null;
        /// <summary> 
        /// 收款方式比例 
        /// </summary> 
        public System.Double? a_nInfoBaseFinance_ReceiveMoneyMode_Proportion = null;
        /// <summary> 
        /// 归属百分比 
        /// </summary> 
        public System.Double? a_nWorkOrderItem_Percentage_PublicRelation_Commission = null;
        /// <summary> 
        /// 业绩比例 
        /// </summary> 
        public System.Double? a_nWorkOrderItem_Percentage_PublicRelation_Achievement = null;
        /// <summary> 
        /// 佣金比例 
        /// </summary> 
        public System.Double? a_nWorkOrderItem_Proportion_Commission = null;
        /// <summary> 
        /// 任务比例 
        /// </summary> 
        public System.Double? a_nWorkOrderItem_Proportion_Task = null;
        /// <summary> 
        /// 广告折扣 
        /// </summary> 
        public System.Double? a_nAdvertisementDiscount = null;
        /// <summary> 
        /// 任务 
        /// </summary> 
        public System.Double? a_nTask = null;
        /// <summary> 
        /// 任务调整额 
        /// </summary> 
        public System.Double? a_nAdjustment_Task = null;
        /// <summary> 
        /// 业绩 
        /// </summary> 
        public System.Double? a_nAchievement = null;
        /// <summary> 
        /// 业绩调整额 
        /// </summary> 
        public System.Double? a_nAdjustment_Achievement = null;
        /// <summary> 
        /// 佣金基数 
        /// </summary> 
        public System.Double? a_nCommissionBasisMoney = null;
        /// <summary> 
        /// 佣金提取比例 
        /// </summary> 
        public System.Double? a_nCommissionProportion = null;
        /// <summary> 
        /// 佣金金额 
        /// </summary> 
        public System.Double? a_nCommission = null;
        /// <summary> 
        /// 佣金调整额 
        /// </summary> 
        public System.Double? a_nAdjustment_Commission = null;
        /// <summary> 
        /// 计提日期 
        /// </summary> 
        public System.DateTime? a_dShouldCalculationDate = null;
        /// <summary> 
        /// 复核日期 
        /// </summary> 
        public System.DateTime? a_dReviewDate = null;
        /// <summary> 
        /// 撤消复核日期 
        /// </summary> 
        public System.DateTime? a_dCancelReviewDate = null;
        /// <summary> 
        /// 平帐日期 
        /// </summary> 
        public System.DateTime? a_dClearArrearsDate = null;
        /// <summary> 
        /// 见报日期 
        /// </summary> 
        public System.DateTime? a_dPublishDate = null;
        /// <summary> 
        /// 是否复核 
        /// </summary> 
        public System.Boolean? a_bReview = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sGuidWorkCharge != null) { this.a_sGuidWorkCharge = ReplaceString.GetReplaceString(this.a_sGuidWorkCharge); }
            if (this.a_sGuidWorkOrderItem_Charge != null) { this.a_sGuidWorkOrderItem_Charge = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem_Charge); }
            if (this.a_sGuidBase_Department_1 != null) { this.a_sGuidBase_Department_1 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_1); }
            if (this.a_sGuidBase_Department_2 != null) { this.a_sGuidBase_Department_2 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_2); }
            if (this.a_sGuidBase_Department_3 != null) { this.a_sGuidBase_Department_3 = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_3); }
            if (this.a_sNameBase_Department_1 != null) { this.a_sNameBase_Department_1 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_1); }
            if (this.a_sNameBase_Department_2 != null) { this.a_sNameBase_Department_2 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_2); }
            if (this.a_sNameBase_Department_3 != null) { this.a_sNameBase_Department_3 = ReplaceString.GetReplaceString(this.a_sNameBase_Department_3); }
            if (this.a_sGuidBase_Department_Person_PublicRelations != null) { this.a_sGuidBase_Department_Person_PublicRelations = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_PublicRelations); }
            if (this.a_sNameBase_Department_Person_PublicRelations != null) { this.a_sNameBase_Department_Person_PublicRelations = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_PublicRelations); }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { this.a_sGuidBaseCommision_Policy_PublicRelations = ReplaceString.GetReplaceString(this.a_sGuidBaseCommision_Policy_PublicRelations); }
            if (this.a_sNameBaseCommision_Policy_PublicRelations != null) { this.a_sNameBaseCommision_Policy_PublicRelations = ReplaceString.GetReplaceString(this.a_sNameBaseCommision_Policy_PublicRelations); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkSalary_Commision_PublicRelations( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_sGuidWorkCharge != null) { mySqlScript += "sGuidWorkCharge,"; }
            if (this.a_sGuidWorkOrderItem_Charge != null) { mySqlScript += "sGuidWorkOrderItem_Charge,"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "sGuidBase_Department_1,"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "sGuidBase_Department_2,"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "sGuidBase_Department_3,"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "sNameBase_Department_1,"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "sNameBase_Department_2,"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "sNameBase_Department_3,"; }
            if (this.a_sGuidBase_Department_Person_PublicRelations != null) { mySqlScript += "sGuidBase_Department_Person_PublicRelations,"; }
            if (this.a_sNameBase_Department_Person_PublicRelations != null) { mySqlScript += "sNameBase_Department_Person_PublicRelations,"; }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { mySqlScript += "sGuidBaseCommision_Policy_PublicRelations,"; }
            if (this.a_sNameBaseCommision_Policy_PublicRelations != null) { mySqlScript += "sNameBaseCommision_Policy_PublicRelations,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_nSignedMoney != null) { mySqlScript += "nSignedMoney,"; }
            if (this.a_nClearArrearsMoney != null) { mySqlScript += "nClearArrearsMoney,"; }
            if (this.a_nInfoBaseFinance_ReceiveMoneyMode_Proportion != null) { mySqlScript += "nInfoBaseFinance_ReceiveMoneyMode_Proportion,"; }
            if (this.a_nWorkOrderItem_Percentage_PublicRelation_Commission != null) { mySqlScript += "nWorkOrderItem_Percentage_PublicRelation_Commission,"; }
            if (this.a_nWorkOrderItem_Percentage_PublicRelation_Achievement != null) { mySqlScript += "nWorkOrderItem_Percentage_PublicRelation_Achievement,"; }
            if (this.a_nWorkOrderItem_Proportion_Commission != null) { mySqlScript += "nWorkOrderItem_Proportion_Commission,"; }
            if (this.a_nWorkOrderItem_Proportion_Task != null) { mySqlScript += "nWorkOrderItem_Proportion_Task,"; }
            if (this.a_nAdvertisementDiscount != null) { mySqlScript += "nAdvertisementDiscount,"; }
            if (this.a_nTask != null) { mySqlScript += "nTask,"; }
            if (this.a_nAdjustment_Task != null) { mySqlScript += "nAdjustment_Task,"; }
            if (this.a_nAchievement != null) { mySqlScript += "nAchievement,"; }
            if (this.a_nAdjustment_Achievement != null) { mySqlScript += "nAdjustment_Achievement,"; }
            if (this.a_nCommissionBasisMoney != null) { mySqlScript += "nCommissionBasisMoney,"; }
            if (this.a_nCommissionProportion != null) { mySqlScript += "nCommissionProportion,"; }
            if (this.a_nCommission != null) { mySqlScript += "nCommission,"; }
            if (this.a_nAdjustment_Commission != null) { mySqlScript += "nAdjustment_Commission,"; }
            if (this.a_dShouldCalculationDate != null) { mySqlScript += "dShouldCalculationDate,"; }
            if (this.a_dReviewDate != null) { mySqlScript += "dReviewDate,"; }
            if (this.a_dCancelReviewDate != null) { mySqlScript += "dCancelReviewDate,"; }
            if (this.a_dClearArrearsDate != null) { mySqlScript += "dClearArrearsDate,"; }
            if (this.a_dPublishDate != null) { mySqlScript += "dPublishDate,"; }
            if (this.a_bReview != null) { mySqlScript += "bReview,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sGuidWorkCharge != null) { mySqlScript += "'" + this.a_sGuidWorkCharge + "',"; }
            if (this.a_sGuidWorkOrderItem_Charge != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem_Charge + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { mySqlScript += "'" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_sNameBase_Department_1 != null) { mySqlScript += "'" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { mySqlScript += "'" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { mySqlScript += "'" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person_PublicRelations != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_PublicRelations + "',"; }
            if (this.a_sNameBase_Department_Person_PublicRelations != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_PublicRelations + "',"; }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { mySqlScript += "'" + this.a_sGuidBaseCommision_Policy_PublicRelations + "',"; }
            if (this.a_sNameBaseCommision_Policy_PublicRelations != null) { mySqlScript += "'" + this.a_sNameBaseCommision_Policy_PublicRelations + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_nSignedMoney != null) { mySqlScript += this.a_nSignedMoney + ","; }
            if (this.a_nClearArrearsMoney != null) { mySqlScript += this.a_nClearArrearsMoney + ","; }
            if (this.a_nInfoBaseFinance_ReceiveMoneyMode_Proportion != null) { mySqlScript += this.a_nInfoBaseFinance_ReceiveMoneyMode_Proportion + ","; }
            if (this.a_nWorkOrderItem_Percentage_PublicRelation_Commission != null) { mySqlScript += this.a_nWorkOrderItem_Percentage_PublicRelation_Commission + ","; }
            if (this.a_nWorkOrderItem_Percentage_PublicRelation_Achievement != null) { mySqlScript += this.a_nWorkOrderItem_Percentage_PublicRelation_Achievement + ","; }
            if (this.a_nWorkOrderItem_Proportion_Commission != null) { mySqlScript += this.a_nWorkOrderItem_Proportion_Commission + ","; }
            if (this.a_nWorkOrderItem_Proportion_Task != null) { mySqlScript += this.a_nWorkOrderItem_Proportion_Task + ","; }
            if (this.a_nAdvertisementDiscount != null) { mySqlScript += this.a_nAdvertisementDiscount + ","; }
            if (this.a_nTask != null) { mySqlScript += this.a_nTask + ","; }
            if (this.a_nAdjustment_Task != null) { mySqlScript += this.a_nAdjustment_Task + ","; }
            if (this.a_nAchievement != null) { mySqlScript += this.a_nAchievement + ","; }
            if (this.a_nAdjustment_Achievement != null) { mySqlScript += this.a_nAdjustment_Achievement + ","; }
            if (this.a_nCommissionBasisMoney != null) { mySqlScript += this.a_nCommissionBasisMoney + ","; }
            if (this.a_nCommissionProportion != null) { mySqlScript += this.a_nCommissionProportion + ","; }
            if (this.a_nCommission != null) { mySqlScript += this.a_nCommission + ","; }
            if (this.a_nAdjustment_Commission != null) { mySqlScript += this.a_nAdjustment_Commission + ","; }
            if (this.a_dShouldCalculationDate != null) { mySqlScript += "'" + this.a_dShouldCalculationDate + "',"; }
            if (this.a_dReviewDate != null) { mySqlScript += "'" + this.a_dReviewDate + "',"; }
            if (this.a_dCancelReviewDate != null) { mySqlScript += "'" + this.a_dCancelReviewDate + "',"; }
            if (this.a_dClearArrearsDate != null) { mySqlScript += "'" + this.a_dClearArrearsDate + "',"; }
            if (this.a_dPublishDate != null) { mySqlScript += "'" + this.a_dPublishDate + "',"; }
            if (this.a_bReview != null) { mySqlScript += "'" + this.a_bReview + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkSalary_Commision_PublicRelations set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sGuidWorkCharge != null) { iColumnCount++; mySqlScript += " sGuidWorkCharge = '" + this.a_sGuidWorkCharge + "',"; }
            if (this.a_sGuidWorkOrderItem_Charge != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem_Charge = '" + this.a_sGuidWorkOrderItem_Charge + "',"; }
            if (this.a_sGuidBase_Department_1 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_1 = '" + this.a_sGuidBase_Department_1 + "',"; }
            if (this.a_sGuidBase_Department_2 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_2 = '" + this.a_sGuidBase_Department_2 + "',"; }
            if (this.a_sGuidBase_Department_3 != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_3 = '" + this.a_sGuidBase_Department_3 + "',"; }
            if (this.a_sNameBase_Department_1 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_1 = '" + this.a_sNameBase_Department_1 + "',"; }
            if (this.a_sNameBase_Department_2 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_2 = '" + this.a_sNameBase_Department_2 + "',"; }
            if (this.a_sNameBase_Department_3 != null) { iColumnCount++; mySqlScript += " sNameBase_Department_3 = '" + this.a_sNameBase_Department_3 + "',"; }
            if (this.a_sGuidBase_Department_Person_PublicRelations != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_PublicRelations = '" + this.a_sGuidBase_Department_Person_PublicRelations + "',"; }
            if (this.a_sNameBase_Department_Person_PublicRelations != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_PublicRelations = '" + this.a_sNameBase_Department_Person_PublicRelations + "',"; }
            if (this.a_sGuidBaseCommision_Policy_PublicRelations != null) { iColumnCount++; mySqlScript += " sGuidBaseCommision_Policy_PublicRelations = '" + this.a_sGuidBaseCommision_Policy_PublicRelations + "',"; }
            if (this.a_sNameBaseCommision_Policy_PublicRelations != null) { iColumnCount++; mySqlScript += " sNameBaseCommision_Policy_PublicRelations = '" + this.a_sNameBaseCommision_Policy_PublicRelations + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_nSignedMoney != null) { iColumnCount++; mySqlScript += " nSignedMoney = " + this.a_nSignedMoney + ","; }
            if (this.a_nClearArrearsMoney != null) { iColumnCount++; mySqlScript += " nClearArrearsMoney = " + this.a_nClearArrearsMoney + ","; }
            if (this.a_nInfoBaseFinance_ReceiveMoneyMode_Proportion != null) { iColumnCount++; mySqlScript += " nInfoBaseFinance_ReceiveMoneyMode_Proportion = " + this.a_nInfoBaseFinance_ReceiveMoneyMode_Proportion + ","; }
            if (this.a_nWorkOrderItem_Percentage_PublicRelation_Commission != null) { iColumnCount++; mySqlScript += " nWorkOrderItem_Percentage_PublicRelation_Commission = " + this.a_nWorkOrderItem_Percentage_PublicRelation_Commission + ","; }
            if (this.a_nWorkOrderItem_Percentage_PublicRelation_Achievement != null) { iColumnCount++; mySqlScript += " nWorkOrderItem_Percentage_PublicRelation_Achievement = " + this.a_nWorkOrderItem_Percentage_PublicRelation_Achievement + ","; }
            if (this.a_nWorkOrderItem_Proportion_Commission != null) { iColumnCount++; mySqlScript += " nWorkOrderItem_Proportion_Commission = " + this.a_nWorkOrderItem_Proportion_Commission + ","; }
            if (this.a_nWorkOrderItem_Proportion_Task != null) { iColumnCount++; mySqlScript += " nWorkOrderItem_Proportion_Task = " + this.a_nWorkOrderItem_Proportion_Task + ","; }
            if (this.a_nAdvertisementDiscount != null) { iColumnCount++; mySqlScript += " nAdvertisementDiscount = " + this.a_nAdvertisementDiscount + ","; }
            if (this.a_nTask != null) { iColumnCount++; mySqlScript += " nTask = " + this.a_nTask + ","; }
            if (this.a_nAdjustment_Task != null) { iColumnCount++; mySqlScript += " nAdjustment_Task = " + this.a_nAdjustment_Task + ","; }
            if (this.a_nAchievement != null) { iColumnCount++; mySqlScript += " nAchievement = " + this.a_nAchievement + ","; }
            if (this.a_nAdjustment_Achievement != null) { iColumnCount++; mySqlScript += " nAdjustment_Achievement = " + this.a_nAdjustment_Achievement + ","; }
            if (this.a_nCommissionBasisMoney != null) { iColumnCount++; mySqlScript += " nCommissionBasisMoney = " + this.a_nCommissionBasisMoney + ","; }
            if (this.a_nCommissionProportion != null) { iColumnCount++; mySqlScript += " nCommissionProportion = " + this.a_nCommissionProportion + ","; }
            if (this.a_nCommission != null) { iColumnCount++; mySqlScript += " nCommission = " + this.a_nCommission + ","; }
            if (this.a_nAdjustment_Commission != null) { iColumnCount++; mySqlScript += " nAdjustment_Commission = " + this.a_nAdjustment_Commission + ","; }
            if (this.a_dShouldCalculationDate != null) { iColumnCount++; mySqlScript += " dShouldCalculationDate = '" + this.a_dShouldCalculationDate + "',"; }
            if (this.a_dReviewDate != null) { iColumnCount++; mySqlScript += " dReviewDate = '" + this.a_dReviewDate + "',"; }
            if (this.a_dCancelReviewDate != null) { iColumnCount++; mySqlScript += " dCancelReviewDate = '" + this.a_dCancelReviewDate + "',"; }
            if (this.a_dClearArrearsDate != null) { iColumnCount++; mySqlScript += " dClearArrearsDate = '" + this.a_dClearArrearsDate + "',"; }
            if (this.a_dPublishDate != null) { iColumnCount++; mySqlScript += " dPublishDate = '" + this.a_dPublishDate + "',"; }
            if (this.a_bReview != null) { iColumnCount++; mySqlScript += " bReview = '" + this.a_bReview + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkSalary_Commision_PublicRelations Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    public partial class Sql_WorkSalary_Commision_PublicRelations_Award
    {
        #region 与数据表()对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkSalary_Commision_PublicRelations_Award( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkSalary_Commision_PublicRelations_Award set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkSalary_Commision_PublicRelations_Award Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //代理人组稿费表( WorkSalary_Deputy_Award )  
    /// <summary>
    /// 代理人组稿费表
    /// </summary>
    public partial class Sql_WorkSalary_Deputy_Award
    {
        #region 与数据表(代理人组稿费表)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 刊期ID 
        /// </summary> 
        public System.String a_sGuidWorkOrderItem = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 客户 
        /// </summary> 
        public System.String a_sNameBaseCRM_Customer = null;
        /// <summary> 
        /// 代理人ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer_Deputy = null;
        /// <summary> 
        /// 代理人 
        /// </summary> 
        public System.String a_sNameBaseCRM_Customer_Deputy = null;
        /// <summary> 
        /// 版位类别ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 版位类别 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_PagePositionType = null;
        /// <summary> 
        /// 色彩ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Color = null;
        /// <summary> 
        /// 色彩 
        /// </summary> 
        public System.String a_sNameBasePrice_Color = null;
        /// <summary> 
        /// 规格ID 
        /// </summary> 
        public System.String a_sGuidBasePrice_Media_Specification = null;
        /// <summary> 
        /// 规格 
        /// </summary> 
        public System.String a_sNameBasePrice_Media_Specification = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 广告标题 
        /// </summary> 
        public System.String a_sAdvertisingTitle = null;
        /// <summary> 
        /// 付款类别ID 
        /// </summary> 
        public System.String a_sGuidBaseOrder_PaymentType = null;
        /// <summary> 
        /// 付款类别 
        /// </summary> 
        public System.String a_sNameBaseOrder_PaymentType = null;
        /// <summary> 
        /// 广告折扣 
        /// </summary> 
        public System.Double? a_nAdvertisementDiscount = null;
        /// <summary> 
        /// 签订金额 
        /// </summary> 
        public System.Double? a_nSignedMoney = null;
        /// <summary> 
        /// 组稿费比例 
        /// </summary> 
        public System.Double? a_nProportion_Deputy = null;
        /// <summary> 
        /// 组稿费 
        /// </summary> 
        public System.Double? a_nDeputyReward = null;
        /// <summary> 
        /// 组稿费调整额 
        /// </summary> 
        public System.Double? a_nAdjustment_DeputyReward = null;
        /// <summary> 
        /// 调整后金额 
        /// </summary> 
        public System.Double? a_nDeputyReward_AfterAdjustment = null;
        /// <summary> 
        /// 刊出日期 
        /// </summary> 
        public System.DateTime? a_dPublishDate = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkOrderItem != null) { this.a_sGuidWorkOrderItem = ReplaceString.GetReplaceString(this.a_sGuidWorkOrderItem); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sNameBaseCRM_Customer != null) { this.a_sNameBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sNameBaseCRM_Customer); }
            if (this.a_sGuidBaseCRM_Customer_Deputy != null) { this.a_sGuidBaseCRM_Customer_Deputy = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer_Deputy); }
            if (this.a_sNameBaseCRM_Customer_Deputy != null) { this.a_sNameBaseCRM_Customer_Deputy = ReplaceString.GetReplaceString(this.a_sNameBaseCRM_Customer_Deputy); }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { this.a_sGuidBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_PagePositionType); }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { this.a_sNameBasePrice_Media_PagePositionType = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_PagePositionType); }
            if (this.a_sGuidBasePrice_Color != null) { this.a_sGuidBasePrice_Color = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Color); }
            if (this.a_sNameBasePrice_Color != null) { this.a_sNameBasePrice_Color = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Color); }
            if (this.a_sGuidBasePrice_Media_Specification != null) { this.a_sGuidBasePrice_Media_Specification = ReplaceString.GetReplaceString(this.a_sGuidBasePrice_Media_Specification); }
            if (this.a_sNameBasePrice_Media_Specification != null) { this.a_sNameBasePrice_Media_Specification = ReplaceString.GetReplaceString(this.a_sNameBasePrice_Media_Specification); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sAdvertisingTitle != null) { this.a_sAdvertisingTitle = ReplaceString.GetReplaceString(this.a_sAdvertisingTitle); }
            if (this.a_sGuidBaseOrder_PaymentType != null) { this.a_sGuidBaseOrder_PaymentType = ReplaceString.GetReplaceString(this.a_sGuidBaseOrder_PaymentType); }
            if (this.a_sNameBaseOrder_PaymentType != null) { this.a_sNameBaseOrder_PaymentType = ReplaceString.GetReplaceString(this.a_sNameBaseOrder_PaymentType); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkSalary_Deputy_Award( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "sGuidWorkOrderItem,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_sNameBaseCRM_Customer != null) { mySqlScript += "sNameBaseCRM_Customer,"; }
            if (this.a_sGuidBaseCRM_Customer_Deputy != null) { mySqlScript += "sGuidBaseCRM_Customer_Deputy,"; }
            if (this.a_sNameBaseCRM_Customer_Deputy != null) { mySqlScript += "sNameBaseCRM_Customer_Deputy,"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "sGuidBasePrice_Media_PagePositionType,"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "sNameBasePrice_Media_PagePositionType,"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "sGuidBasePrice_Color,"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "sNameBasePrice_Color,"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { mySqlScript += "sGuidBasePrice_Media_Specification,"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { mySqlScript += "sNameBasePrice_Media_Specification,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sAdvertisingTitle != null) { mySqlScript += "sAdvertisingTitle,"; }
            if (this.a_sGuidBaseOrder_PaymentType != null) { mySqlScript += "sGuidBaseOrder_PaymentType,"; }
            if (this.a_sNameBaseOrder_PaymentType != null) { mySqlScript += "sNameBaseOrder_PaymentType,"; }
            if (this.a_nAdvertisementDiscount != null) { mySqlScript += "nAdvertisementDiscount,"; }
            if (this.a_nSignedMoney != null) { mySqlScript += "nSignedMoney,"; }
            if (this.a_nProportion_Deputy != null) { mySqlScript += "nProportion_Deputy,"; }
            if (this.a_nDeputyReward != null) { mySqlScript += "nDeputyReward,"; }
            if (this.a_nAdjustment_DeputyReward != null) { mySqlScript += "nAdjustment_DeputyReward,"; }
            if (this.a_nDeputyReward_AfterAdjustment != null) { mySqlScript += "nDeputyReward_AfterAdjustment,"; }
            if (this.a_dPublishDate != null) { mySqlScript += "dPublishDate,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { mySqlScript += "'" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sNameBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sNameBaseCRM_Customer + "',"; }
            if (this.a_sGuidBaseCRM_Customer_Deputy != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer_Deputy + "',"; }
            if (this.a_sNameBaseCRM_Customer_Deputy != null) { mySqlScript += "'" + this.a_sNameBaseCRM_Customer_Deputy + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { mySqlScript += "'" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_sGuidBasePrice_Media_Specification + "',"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { mySqlScript += "'" + this.a_sNameBasePrice_Media_Specification + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sAdvertisingTitle != null) { mySqlScript += "'" + this.a_sAdvertisingTitle + "',"; }
            if (this.a_sGuidBaseOrder_PaymentType != null) { mySqlScript += "'" + this.a_sGuidBaseOrder_PaymentType + "',"; }
            if (this.a_sNameBaseOrder_PaymentType != null) { mySqlScript += "'" + this.a_sNameBaseOrder_PaymentType + "',"; }
            if (this.a_nAdvertisementDiscount != null) { mySqlScript += this.a_nAdvertisementDiscount + ","; }
            if (this.a_nSignedMoney != null) { mySqlScript += this.a_nSignedMoney + ","; }
            if (this.a_nProportion_Deputy != null) { mySqlScript += this.a_nProportion_Deputy + ","; }
            if (this.a_nDeputyReward != null) { mySqlScript += this.a_nDeputyReward + ","; }
            if (this.a_nAdjustment_DeputyReward != null) { mySqlScript += this.a_nAdjustment_DeputyReward + ","; }
            if (this.a_nDeputyReward_AfterAdjustment != null) { mySqlScript += this.a_nDeputyReward_AfterAdjustment + ","; }
            if (this.a_dPublishDate != null) { mySqlScript += "'" + this.a_dPublishDate + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkSalary_Deputy_Award set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkOrderItem != null) { iColumnCount++; mySqlScript += " sGuidWorkOrderItem = '" + this.a_sGuidWorkOrderItem + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sNameBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sNameBaseCRM_Customer = '" + this.a_sNameBaseCRM_Customer + "',"; }
            if (this.a_sGuidBaseCRM_Customer_Deputy != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer_Deputy = '" + this.a_sGuidBaseCRM_Customer_Deputy + "',"; }
            if (this.a_sNameBaseCRM_Customer_Deputy != null) { iColumnCount++; mySqlScript += " sNameBaseCRM_Customer_Deputy = '" + this.a_sNameBaseCRM_Customer_Deputy + "',"; }
            if (this.a_sGuidBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_PagePositionType = '" + this.a_sGuidBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sNameBasePrice_Media_PagePositionType != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_PagePositionType = '" + this.a_sNameBasePrice_Media_PagePositionType + "',"; }
            if (this.a_sGuidBasePrice_Color != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Color = '" + this.a_sGuidBasePrice_Color + "',"; }
            if (this.a_sNameBasePrice_Color != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Color = '" + this.a_sNameBasePrice_Color + "',"; }
            if (this.a_sGuidBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " sGuidBasePrice_Media_Specification = '" + this.a_sGuidBasePrice_Media_Specification + "',"; }
            if (this.a_sNameBasePrice_Media_Specification != null) { iColumnCount++; mySqlScript += " sNameBasePrice_Media_Specification = '" + this.a_sNameBasePrice_Media_Specification + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sAdvertisingTitle != null) { iColumnCount++; mySqlScript += " sAdvertisingTitle = '" + this.a_sAdvertisingTitle + "',"; }
            if (this.a_sGuidBaseOrder_PaymentType != null) { iColumnCount++; mySqlScript += " sGuidBaseOrder_PaymentType = '" + this.a_sGuidBaseOrder_PaymentType + "',"; }
            if (this.a_sNameBaseOrder_PaymentType != null) { iColumnCount++; mySqlScript += " sNameBaseOrder_PaymentType = '" + this.a_sNameBaseOrder_PaymentType + "',"; }
            if (this.a_nAdvertisementDiscount != null) { iColumnCount++; mySqlScript += " nAdvertisementDiscount = " + this.a_nAdvertisementDiscount + ","; }
            if (this.a_nSignedMoney != null) { iColumnCount++; mySqlScript += " nSignedMoney = " + this.a_nSignedMoney + ","; }
            if (this.a_nProportion_Deputy != null) { iColumnCount++; mySqlScript += " nProportion_Deputy = " + this.a_nProportion_Deputy + ","; }
            if (this.a_nDeputyReward != null) { iColumnCount++; mySqlScript += " nDeputyReward = " + this.a_nDeputyReward + ","; }
            if (this.a_nAdjustment_DeputyReward != null) { iColumnCount++; mySqlScript += " nAdjustment_DeputyReward = " + this.a_nAdjustment_DeputyReward + ","; }
            if (this.a_nDeputyReward_AfterAdjustment != null) { iColumnCount++; mySqlScript += " nDeputyReward_AfterAdjustment = " + this.a_nDeputyReward_AfterAdjustment + ","; }
            if (this.a_dPublishDate != null) { iColumnCount++; mySqlScript += " dPublishDate = '" + this.a_dPublishDate + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkSalary_Deputy_Award Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //销售活动( WorkSales_Activity )  
    /// <summary>
    /// 销售活动
    /// </summary>
    public partial class Sql_WorkSales_Activity
    {
        #region 与数据表(销售活动)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建时间 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 分类ID 
        /// </summary> 
        public System.String a_sGuidBaseSales_Activity_Categories = null;
        /// <summary> 
        /// 分类 
        /// </summary> 
        public System.String a_sNameBaseSales_Activity_Categories = null;
        /// <summary> 
        /// 状态ID 
        /// </summary> 
        public System.String a_sGuidBaseSales_Activity_Status = null;
        /// <summary> 
        /// 状态 
        /// </summary> 
        public System.String a_sNameBaseSales_Activity_Status = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 内容 
        /// </summary> 
        public System.String a_sContent = null;
        /// <summary> 
        /// 目的 
        /// </summary> 
        public System.String a_sPurpose = null;
        /// <summary> 
        /// 开始日期 
        /// </summary> 
        public System.DateTime? a_dStartDate = null;
        /// <summary> 
        /// 结束日期 
        /// </summary> 
        public System.DateTime? a_dEndDate = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseSales_Activity_Categories != null) { this.a_sGuidBaseSales_Activity_Categories = ReplaceString.GetReplaceString(this.a_sGuidBaseSales_Activity_Categories); }
            if (this.a_sNameBaseSales_Activity_Categories != null) { this.a_sNameBaseSales_Activity_Categories = ReplaceString.GetReplaceString(this.a_sNameBaseSales_Activity_Categories); }
            if (this.a_sGuidBaseSales_Activity_Status != null) { this.a_sGuidBaseSales_Activity_Status = ReplaceString.GetReplaceString(this.a_sGuidBaseSales_Activity_Status); }
            if (this.a_sNameBaseSales_Activity_Status != null) { this.a_sNameBaseSales_Activity_Status = ReplaceString.GetReplaceString(this.a_sNameBaseSales_Activity_Status); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sContent != null) { this.a_sContent = ReplaceString.GetReplaceString(this.a_sContent); }
            if (this.a_sPurpose != null) { this.a_sPurpose = ReplaceString.GetReplaceString(this.a_sPurpose); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkSales_Activity( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBaseSales_Activity_Categories != null) { mySqlScript += "sGuidBaseSales_Activity_Categories,"; }
            if (this.a_sNameBaseSales_Activity_Categories != null) { mySqlScript += "sNameBaseSales_Activity_Categories,"; }
            if (this.a_sGuidBaseSales_Activity_Status != null) { mySqlScript += "sGuidBaseSales_Activity_Status,"; }
            if (this.a_sNameBaseSales_Activity_Status != null) { mySqlScript += "sNameBaseSales_Activity_Status,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sContent != null) { mySqlScript += "sContent,"; }
            if (this.a_sPurpose != null) { mySqlScript += "sPurpose,"; }
            if (this.a_dStartDate != null) { mySqlScript += "dStartDate,"; }
            if (this.a_dEndDate != null) { mySqlScript += "dEndDate,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBaseSales_Activity_Categories != null) { mySqlScript += "'" + this.a_sGuidBaseSales_Activity_Categories + "',"; }
            if (this.a_sNameBaseSales_Activity_Categories != null) { mySqlScript += "'" + this.a_sNameBaseSales_Activity_Categories + "',"; }
            if (this.a_sGuidBaseSales_Activity_Status != null) { mySqlScript += "'" + this.a_sGuidBaseSales_Activity_Status + "',"; }
            if (this.a_sNameBaseSales_Activity_Status != null) { mySqlScript += "'" + this.a_sNameBaseSales_Activity_Status + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sContent != null) { mySqlScript += "'" + this.a_sContent + "',"; }
            if (this.a_sPurpose != null) { mySqlScript += "'" + this.a_sPurpose + "',"; }
            if (this.a_dStartDate != null) { mySqlScript += "'" + this.a_dStartDate + "',"; }
            if (this.a_dEndDate != null) { mySqlScript += "'" + this.a_dEndDate + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkSales_Activity set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBaseSales_Activity_Categories != null) { iColumnCount++; mySqlScript += " sGuidBaseSales_Activity_Categories = '" + this.a_sGuidBaseSales_Activity_Categories + "',"; }
            if (this.a_sNameBaseSales_Activity_Categories != null) { iColumnCount++; mySqlScript += " sNameBaseSales_Activity_Categories = '" + this.a_sNameBaseSales_Activity_Categories + "',"; }
            if (this.a_sGuidBaseSales_Activity_Status != null) { iColumnCount++; mySqlScript += " sGuidBaseSales_Activity_Status = '" + this.a_sGuidBaseSales_Activity_Status + "',"; }
            if (this.a_sNameBaseSales_Activity_Status != null) { iColumnCount++; mySqlScript += " sNameBaseSales_Activity_Status = '" + this.a_sNameBaseSales_Activity_Status + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sContent != null) { iColumnCount++; mySqlScript += " sContent = '" + this.a_sContent + "',"; }
            if (this.a_sPurpose != null) { iColumnCount++; mySqlScript += " sPurpose = '" + this.a_sPurpose + "',"; }
            if (this.a_dStartDate != null) { iColumnCount++; mySqlScript += " dStartDate = '" + this.a_dStartDate + "',"; }
            if (this.a_dEndDate != null) { iColumnCount++; mySqlScript += " dEndDate = '" + this.a_dEndDate + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkSales_Activity Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //销售活动客户( WorkSales_Activity_Customers )  
    /// <summary>
    /// 销售活动客户
    /// </summary>
    public partial class Sql_WorkSales_Activity_Customers
    {
        #region 与数据表(销售活动客户)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 活动ID 
        /// </summary> 
        public System.String a_sGuidWorkSales_Activity = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sNameBaseCRM_Customer = null;
        /// <summary> 
        /// 是否主要 
        /// </summary> 
        public System.Boolean? a_bMain = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkSales_Activity != null) { this.a_sGuidWorkSales_Activity = ReplaceString.GetReplaceString(this.a_sGuidWorkSales_Activity); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sNameBaseCRM_Customer != null) { this.a_sNameBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sNameBaseCRM_Customer); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkSales_Activity_Customers( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkSales_Activity != null) { mySqlScript += "sGuidWorkSales_Activity,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sNameBaseCRM_Customer != null) { mySqlScript += "sNameBaseCRM_Customer,"; }
            if (this.a_bMain != null) { mySqlScript += "bMain,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkSales_Activity != null) { mySqlScript += "'" + this.a_sGuidWorkSales_Activity + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sNameBaseCRM_Customer + "',"; }
            if (this.a_bMain != null) { mySqlScript += "'" + this.a_bMain + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkSales_Activity_Customers set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkSales_Activity != null) { iColumnCount++; mySqlScript += " sGuidWorkSales_Activity = '" + this.a_sGuidWorkSales_Activity + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sNameBaseCRM_Customer = '" + this.a_sNameBaseCRM_Customer + "',"; }
            if (this.a_bMain != null) { iColumnCount++; mySqlScript += " bMain = '" + this.a_bMain + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkSales_Activity_Customers Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //销售活动人员( WorkSales_Activity_Person )  
    /// <summary>
    /// 销售活动人员
    /// </summary>
    public partial class Sql_WorkSales_Activity_Person
    {
        #region 与数据表(销售活动人员)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 活动ID 
        /// </summary> 
        public System.String a_sGuidWorkSales_Activity = null;
        /// <summary> 
        /// 人员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 人员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person = null;
        /// <summary> 
        /// 是否主要 
        /// </summary> 
        public System.Boolean? a_bMain = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkSales_Activity != null) { this.a_sGuidWorkSales_Activity = ReplaceString.GetReplaceString(this.a_sGuidWorkSales_Activity); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sNameBase_Department_Person != null) { this.a_sNameBase_Department_Person = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkSales_Activity_Person( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_sGuidWorkSales_Activity != null) { mySqlScript += "sGuidWorkSales_Activity,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "sNameBase_Department_Person,"; }
            if (this.a_bMain != null) { mySqlScript += "bMain,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkSales_Activity != null) { mySqlScript += "'" + this.a_sGuidWorkSales_Activity + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_bMain != null) { mySqlScript += "'" + this.a_bMain + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkSales_Activity_Person set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_sGuidWorkSales_Activity != null) { iColumnCount++; mySqlScript += " sGuidWorkSales_Activity = '" + this.a_sGuidWorkSales_Activity + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sNameBase_Department_Person != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person = '" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_bMain != null) { iColumnCount++; mySqlScript += " bMain = '" + this.a_bMain + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkSales_Activity_Person Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //销售活动跟踪( WorkSales_ActivityTrace )  
    /// <summary>
    /// 销售活动跟踪
    /// </summary>
    public partial class Sql_WorkSales_ActivityTrace
    {
        #region 与数据表(销售活动跟踪)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建时间 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 活动ID 
        /// </summary> 
        public System.String a_sGuidWorkSales_Activity = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 跟踪人ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Trace = null;
        /// <summary> 
        /// 跟踪人 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Trace = null;
        /// <summary> 
        /// 开始时间 
        /// </summary> 
        public System.DateTime? a_dStartDate = null;
        /// <summary> 
        /// 结束时间 
        /// </summary> 
        public System.DateTime? a_dEndDate = null;
        /// <summary> 
        /// 跟踪分类ID 
        /// </summary> 
        public System.String a_sGuidBaseSales_ActivityTrace_Categories = null;
        /// <summary> 
        /// 跟踪分类 
        /// </summary> 
        public System.String a_sNameBaseSales_ActivityTrace_Categories = null;
        /// <summary> 
        /// 跟踪内容 
        /// </summary> 
        public System.String a_sTraceContent = null;
        /// <summary> 
        /// 跟踪报告 
        /// </summary> 
        public System.String a_sTraceReport = null;
        /// <summary> 
        /// 备注 
        /// </summary> 
        public System.String a_sRemark = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidWorkSales_Activity != null) { this.a_sGuidWorkSales_Activity = ReplaceString.GetReplaceString(this.a_sGuidWorkSales_Activity); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sGuidBase_Department_Person_Trace != null) { this.a_sGuidBase_Department_Person_Trace = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Trace); }
            if (this.a_sNameBase_Department_Person_Trace != null) { this.a_sNameBase_Department_Person_Trace = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Trace); }
            if (this.a_sGuidBaseSales_ActivityTrace_Categories != null) { this.a_sGuidBaseSales_ActivityTrace_Categories = ReplaceString.GetReplaceString(this.a_sGuidBaseSales_ActivityTrace_Categories); }
            if (this.a_sNameBaseSales_ActivityTrace_Categories != null) { this.a_sNameBaseSales_ActivityTrace_Categories = ReplaceString.GetReplaceString(this.a_sNameBaseSales_ActivityTrace_Categories); }
            if (this.a_sTraceContent != null) { this.a_sTraceContent = ReplaceString.GetReplaceString(this.a_sTraceContent); }
            if (this.a_sTraceReport != null) { this.a_sTraceReport = ReplaceString.GetReplaceString(this.a_sTraceReport); }
            if (this.a_sRemark != null) { this.a_sRemark = ReplaceString.GetReplaceString(this.a_sRemark); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkSales_ActivityTrace( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidWorkSales_Activity != null) { mySqlScript += "sGuidWorkSales_Activity,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sGuidBase_Department_Person_Trace != null) { mySqlScript += "sGuidBase_Department_Person_Trace,"; }
            if (this.a_sNameBase_Department_Person_Trace != null) { mySqlScript += "sNameBase_Department_Person_Trace,"; }
            if (this.a_dStartDate != null) { mySqlScript += "dStartDate,"; }
            if (this.a_dEndDate != null) { mySqlScript += "dEndDate,"; }
            if (this.a_sGuidBaseSales_ActivityTrace_Categories != null) { mySqlScript += "sGuidBaseSales_ActivityTrace_Categories,"; }
            if (this.a_sNameBaseSales_ActivityTrace_Categories != null) { mySqlScript += "sNameBaseSales_ActivityTrace_Categories,"; }
            if (this.a_sTraceContent != null) { mySqlScript += "sTraceContent,"; }
            if (this.a_sTraceReport != null) { mySqlScript += "sTraceReport,"; }
            if (this.a_sRemark != null) { mySqlScript += "sRemark,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkSales_Activity != null) { mySqlScript += "'" + this.a_sGuidWorkSales_Activity + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBase_Department_Person_Trace != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Trace + "',"; }
            if (this.a_sNameBase_Department_Person_Trace != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Trace + "',"; }
            if (this.a_dStartDate != null) { mySqlScript += "'" + this.a_dStartDate + "',"; }
            if (this.a_dEndDate != null) { mySqlScript += "'" + this.a_dEndDate + "',"; }
            if (this.a_sGuidBaseSales_ActivityTrace_Categories != null) { mySqlScript += "'" + this.a_sGuidBaseSales_ActivityTrace_Categories + "',"; }
            if (this.a_sNameBaseSales_ActivityTrace_Categories != null) { mySqlScript += "'" + this.a_sNameBaseSales_ActivityTrace_Categories + "',"; }
            if (this.a_sTraceContent != null) { mySqlScript += "'" + this.a_sTraceContent + "',"; }
            if (this.a_sTraceReport != null) { mySqlScript += "'" + this.a_sTraceReport + "',"; }
            if (this.a_sRemark != null) { mySqlScript += "'" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkSales_ActivityTrace set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidWorkSales_Activity != null) { iColumnCount++; mySqlScript += " sGuidWorkSales_Activity = '" + this.a_sGuidWorkSales_Activity + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBase_Department_Person_Trace != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Trace = '" + this.a_sGuidBase_Department_Person_Trace + "',"; }
            if (this.a_sNameBase_Department_Person_Trace != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Trace = '" + this.a_sNameBase_Department_Person_Trace + "',"; }
            if (this.a_dStartDate != null) { iColumnCount++; mySqlScript += " dStartDate = '" + this.a_dStartDate + "',"; }
            if (this.a_dEndDate != null) { iColumnCount++; mySqlScript += " dEndDate = '" + this.a_dEndDate + "',"; }
            if (this.a_sGuidBaseSales_ActivityTrace_Categories != null) { iColumnCount++; mySqlScript += " sGuidBaseSales_ActivityTrace_Categories = '" + this.a_sGuidBaseSales_ActivityTrace_Categories + "',"; }
            if (this.a_sNameBaseSales_ActivityTrace_Categories != null) { iColumnCount++; mySqlScript += " sNameBaseSales_ActivityTrace_Categories = '" + this.a_sNameBaseSales_ActivityTrace_Categories + "',"; }
            if (this.a_sTraceContent != null) { iColumnCount++; mySqlScript += " sTraceContent = '" + this.a_sTraceContent + "',"; }
            if (this.a_sTraceReport != null) { iColumnCount++; mySqlScript += " sTraceReport = '" + this.a_sTraceReport + "',"; }
            if (this.a_sRemark != null) { iColumnCount++; mySqlScript += " sRemark = '" + this.a_sRemark + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkSales_ActivityTrace Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //知识资料( WorkSales_Material )  
    /// <summary>
    /// 知识资料
    /// </summary>
    public partial class Sql_WorkSales_Material
    {
        #region 与数据表(知识资料)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 知识库ID 
        /// </summary> 
        public System.String a_sGuidBaseSales_Material_Library = null;
        /// <summary> 
        /// 知识库 
        /// </summary> 
        public System.String a_sNameBaseSales_Material_Library = null;
        /// <summary> 
        /// 资料类别ID 
        /// </summary> 
        public System.String a_sGuidBaseSales_Material_Categories = null;
        /// <summary> 
        /// 资料类别 
        /// </summary> 
        public System.String a_sNameBaseSales_Material_Categories = null;
        /// <summary> 
        /// 作者ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person = null;
        /// <summary> 
        /// 作者 
        /// </summary> 
        public System.String a_sNameBase_Department_Person = null;
        /// <summary> 
        /// 标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 内容 
        /// </summary> 
        public System.String a_sContent = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBaseSales_Material_Library != null) { this.a_sGuidBaseSales_Material_Library = ReplaceString.GetReplaceString(this.a_sGuidBaseSales_Material_Library); }
            if (this.a_sNameBaseSales_Material_Library != null) { this.a_sNameBaseSales_Material_Library = ReplaceString.GetReplaceString(this.a_sNameBaseSales_Material_Library); }
            if (this.a_sGuidBaseSales_Material_Categories != null) { this.a_sGuidBaseSales_Material_Categories = ReplaceString.GetReplaceString(this.a_sGuidBaseSales_Material_Categories); }
            if (this.a_sNameBaseSales_Material_Categories != null) { this.a_sNameBaseSales_Material_Categories = ReplaceString.GetReplaceString(this.a_sNameBaseSales_Material_Categories); }
            if (this.a_sGuidBase_Department_Person != null) { this.a_sGuidBase_Department_Person = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person); }
            if (this.a_sNameBase_Department_Person != null) { this.a_sNameBase_Department_Person = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sContent != null) { this.a_sContent = ReplaceString.GetReplaceString(this.a_sContent); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkSales_Material( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBaseSales_Material_Library != null) { mySqlScript += "sGuidBaseSales_Material_Library,"; }
            if (this.a_sNameBaseSales_Material_Library != null) { mySqlScript += "sNameBaseSales_Material_Library,"; }
            if (this.a_sGuidBaseSales_Material_Categories != null) { mySqlScript += "sGuidBaseSales_Material_Categories,"; }
            if (this.a_sNameBaseSales_Material_Categories != null) { mySqlScript += "sNameBaseSales_Material_Categories,"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "sGuidBase_Department_Person,"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "sNameBase_Department_Person,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sContent != null) { mySqlScript += "sContent,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBaseSales_Material_Library != null) { mySqlScript += "'" + this.a_sGuidBaseSales_Material_Library + "',"; }
            if (this.a_sNameBaseSales_Material_Library != null) { mySqlScript += "'" + this.a_sNameBaseSales_Material_Library + "',"; }
            if (this.a_sGuidBaseSales_Material_Categories != null) { mySqlScript += "'" + this.a_sGuidBaseSales_Material_Categories + "',"; }
            if (this.a_sNameBaseSales_Material_Categories != null) { mySqlScript += "'" + this.a_sNameBaseSales_Material_Categories + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sContent != null) { mySqlScript += "'" + this.a_sContent + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkSales_Material set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBaseSales_Material_Library != null) { iColumnCount++; mySqlScript += " sGuidBaseSales_Material_Library = '" + this.a_sGuidBaseSales_Material_Library + "',"; }
            if (this.a_sNameBaseSales_Material_Library != null) { iColumnCount++; mySqlScript += " sNameBaseSales_Material_Library = '" + this.a_sNameBaseSales_Material_Library + "',"; }
            if (this.a_sGuidBaseSales_Material_Categories != null) { iColumnCount++; mySqlScript += " sGuidBaseSales_Material_Categories = '" + this.a_sGuidBaseSales_Material_Categories + "',"; }
            if (this.a_sNameBaseSales_Material_Categories != null) { iColumnCount++; mySqlScript += " sNameBaseSales_Material_Categories = '" + this.a_sNameBaseSales_Material_Categories + "',"; }
            if (this.a_sGuidBase_Department_Person != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person = '" + this.a_sGuidBase_Department_Person + "',"; }
            if (this.a_sNameBase_Department_Person != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person = '" + this.a_sNameBase_Department_Person + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sContent != null) { iColumnCount++; mySqlScript += " sContent = '" + this.a_sContent + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkSales_Material Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //客户服务( WorkSales_Services )  
    /// <summary>
    /// 客户服务
    /// </summary>
    public partial class Sql_WorkSales_Services
    {
        #region 与数据表(客户服务)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建日期 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 业务员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Employee = null;
        /// <summary> 
        /// 业务员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Employee = null;
        /// <summary> 
        /// 客户ID 
        /// </summary> 
        public System.String a_sGuidBaseCRM_Customer = null;
        /// <summary> 
        /// 客户 
        /// </summary> 
        public System.String a_sNameBaseCRM_Customer = null;
        /// <summary> 
        /// 标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 开始日期 
        /// </summary> 
        public System.DateTime? a_dStartDate = null;
        /// <summary> 
        /// 结束日期 
        /// </summary> 
        public System.DateTime? a_dEndDate = null;
        /// <summary> 
        /// 接洽内容 
        /// </summary> 
        public System.String a_sContent = null;
        /// <summary> 
        /// 接洽结果 
        /// </summary> 
        public System.String a_sResult = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sGuidBase_Department_Person_Employee != null) { this.a_sGuidBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Employee); }
            if (this.a_sNameBase_Department_Person_Employee != null) { this.a_sNameBase_Department_Person_Employee = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Employee); }
            if (this.a_sGuidBaseCRM_Customer != null) { this.a_sGuidBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sGuidBaseCRM_Customer); }
            if (this.a_sNameBaseCRM_Customer != null) { this.a_sNameBaseCRM_Customer = ReplaceString.GetReplaceString(this.a_sNameBaseCRM_Customer); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sContent != null) { this.a_sContent = ReplaceString.GetReplaceString(this.a_sContent); }
            if (this.a_sResult != null) { this.a_sResult = ReplaceString.GetReplaceString(this.a_sResult); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkSales_Services( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "sGuidBase_Department_Person_Employee,"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "sNameBase_Department_Person_Employee,"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "sGuidBaseCRM_Customer,"; }
            if (this.a_sNameBaseCRM_Customer != null) { mySqlScript += "sNameBaseCRM_Customer,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_dStartDate != null) { mySqlScript += "dStartDate,"; }
            if (this.a_dEndDate != null) { mySqlScript += "dEndDate,"; }
            if (this.a_sContent != null) { mySqlScript += "sContent,"; }
            if (this.a_sResult != null) { mySqlScript += "sResult,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sNameBaseCRM_Customer != null) { mySqlScript += "'" + this.a_sNameBaseCRM_Customer + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_dStartDate != null) { mySqlScript += "'" + this.a_dStartDate + "',"; }
            if (this.a_dEndDate != null) { mySqlScript += "'" + this.a_dEndDate + "',"; }
            if (this.a_sContent != null) { mySqlScript += "'" + this.a_sContent + "',"; }
            if (this.a_sResult != null) { mySqlScript += "'" + this.a_sResult + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkSales_Services set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sGuidBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Employee = '" + this.a_sGuidBase_Department_Person_Employee + "',"; }
            if (this.a_sNameBase_Department_Person_Employee != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Employee = '" + this.a_sNameBase_Department_Person_Employee + "',"; }
            if (this.a_sGuidBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sGuidBaseCRM_Customer = '" + this.a_sGuidBaseCRM_Customer + "',"; }
            if (this.a_sNameBaseCRM_Customer != null) { iColumnCount++; mySqlScript += " sNameBaseCRM_Customer = '" + this.a_sNameBaseCRM_Customer + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_dStartDate != null) { iColumnCount++; mySqlScript += " dStartDate = '" + this.a_dStartDate + "',"; }
            if (this.a_dEndDate != null) { iColumnCount++; mySqlScript += " dEndDate = '" + this.a_dEndDate + "',"; }
            if (this.a_sContent != null) { iColumnCount++; mySqlScript += " sContent = '" + this.a_sContent + "',"; }
            if (this.a_sResult != null) { iColumnCount++; mySqlScript += " sResult = '" + this.a_sResult + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkSales_Services Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //工作报告( WorkSales_WorkReport )  
    /// <summary>
    /// 工作报告
    /// </summary>
    public partial class Sql_WorkSales_WorkReport
    {
        #region 与数据表(工作报告)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        /// <summary> 
        /// 创建时间 
        /// </summary> 
        public System.DateTime? a_dCreateDate = null;
        /// <summary> 
        /// 操作员ID 
        /// </summary> 
        public System.String a_sGuidBase_Department_Person_Operator = null;
        /// <summary> 
        /// 操作员 
        /// </summary> 
        public System.String a_sNameBase_Department_Person_Operator = null;
        /// <summary> 
        /// 报告周期种类 
        /// </summary> 
        public System.String a_sNameInfoWorkReportCycleType = null;
        /// <summary> 
        /// 工作报告分类ID 
        /// </summary> 
        public System.String a_sGuidBaseSales_WorkReport_Categories = null;
        /// <summary> 
        /// 报告分类 
        /// </summary> 
        public System.String a_sNameBaseSales_WorkReport_Categories = null;
        /// <summary> 
        /// 标题 
        /// </summary> 
        public System.String a_sTitle = null;
        /// <summary> 
        /// 审批流程ID 
        /// </summary> 
        public System.String a_sGuidBaseApprovalProcess = null;
        /// <summary> 
        /// 审批流程 
        /// </summary> 
        public System.String a_sNameBaseApprovalProcess = null;
        /// <summary> 
        /// 审批状态 
        /// </summary> 
        public System.String a_sApprovalStatus = null;
        /// <summary> 
        /// 开始时间 
        /// </summary> 
        public System.DateTime? a_dStartDate = null;
        /// <summary> 
        /// 结束时间 
        /// </summary> 
        public System.DateTime? a_dEndDate = null;
        /// <summary> 
        /// 报告内容 
        /// </summary> 
        public System.String a_sContent = null;
        /// <summary> 
        /// 需要协助解决的问题 
        /// </summary> 
        public System.String a_sNeedHelpSolutionProblem = null;
        /// <summary> 
        /// 与客户相关的内容 
        /// </summary> 
        public System.String a_sCustomerReferContent = null;
        /// <summary> 
        /// 与广告相关的内容 
        /// </summary> 
        public System.String a_sAdvertiseReferContent = null;
        /// <summary> 
        /// 标识 
        /// </summary> 
        public System.String a_sLogName = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
            if (this.a_sGuidBase_Department_Person_Operator != null) { this.a_sGuidBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sGuidBase_Department_Person_Operator); }
            if (this.a_sNameBase_Department_Person_Operator != null) { this.a_sNameBase_Department_Person_Operator = ReplaceString.GetReplaceString(this.a_sNameBase_Department_Person_Operator); }
            if (this.a_sNameInfoWorkReportCycleType != null) { this.a_sNameInfoWorkReportCycleType = ReplaceString.GetReplaceString(this.a_sNameInfoWorkReportCycleType); }
            if (this.a_sGuidBaseSales_WorkReport_Categories != null) { this.a_sGuidBaseSales_WorkReport_Categories = ReplaceString.GetReplaceString(this.a_sGuidBaseSales_WorkReport_Categories); }
            if (this.a_sNameBaseSales_WorkReport_Categories != null) { this.a_sNameBaseSales_WorkReport_Categories = ReplaceString.GetReplaceString(this.a_sNameBaseSales_WorkReport_Categories); }
            if (this.a_sTitle != null) { this.a_sTitle = ReplaceString.GetReplaceString(this.a_sTitle); }
            if (this.a_sGuidBaseApprovalProcess != null) { this.a_sGuidBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sGuidBaseApprovalProcess); }
            if (this.a_sNameBaseApprovalProcess != null) { this.a_sNameBaseApprovalProcess = ReplaceString.GetReplaceString(this.a_sNameBaseApprovalProcess); }
            if (this.a_sApprovalStatus != null) { this.a_sApprovalStatus = ReplaceString.GetReplaceString(this.a_sApprovalStatus); }
            if (this.a_sContent != null) { this.a_sContent = ReplaceString.GetReplaceString(this.a_sContent); }
            if (this.a_sNeedHelpSolutionProblem != null) { this.a_sNeedHelpSolutionProblem = ReplaceString.GetReplaceString(this.a_sNeedHelpSolutionProblem); }
            if (this.a_sCustomerReferContent != null) { this.a_sCustomerReferContent = ReplaceString.GetReplaceString(this.a_sCustomerReferContent); }
            if (this.a_sAdvertiseReferContent != null) { this.a_sAdvertiseReferContent = ReplaceString.GetReplaceString(this.a_sAdvertiseReferContent); }
            if (this.a_sLogName != null) { this.a_sLogName = ReplaceString.GetReplaceString(this.a_sLogName); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkSales_WorkReport( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            if (this.a_dCreateDate != null) { mySqlScript += "dCreateDate,"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "sGuidBase_Department_Person_Operator,"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "sNameBase_Department_Person_Operator,"; }
            if (this.a_sNameInfoWorkReportCycleType != null) { mySqlScript += "sNameInfoWorkReportCycleType,"; }
            if (this.a_sGuidBaseSales_WorkReport_Categories != null) { mySqlScript += "sGuidBaseSales_WorkReport_Categories,"; }
            if (this.a_sNameBaseSales_WorkReport_Categories != null) { mySqlScript += "sNameBaseSales_WorkReport_Categories,"; }
            if (this.a_sTitle != null) { mySqlScript += "sTitle,"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "sGuidBaseApprovalProcess,"; }
            if (this.a_sNameBaseApprovalProcess != null) { mySqlScript += "sNameBaseApprovalProcess,"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "sApprovalStatus,"; }
            if (this.a_dStartDate != null) { mySqlScript += "dStartDate,"; }
            if (this.a_dEndDate != null) { mySqlScript += "dEndDate,"; }
            if (this.a_sContent != null) { mySqlScript += "sContent,"; }
            if (this.a_sNeedHelpSolutionProblem != null) { mySqlScript += "sNeedHelpSolutionProblem,"; }
            if (this.a_sCustomerReferContent != null) { mySqlScript += "sCustomerReferContent,"; }
            if (this.a_sAdvertiseReferContent != null) { mySqlScript += "sAdvertiseReferContent,"; }
            if (this.a_sLogName != null) { mySqlScript += "sLogName,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { mySqlScript += "'" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { mySqlScript += "'" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sNameInfoWorkReportCycleType != null) { mySqlScript += "'" + this.a_sNameInfoWorkReportCycleType + "',"; }
            if (this.a_sGuidBaseSales_WorkReport_Categories != null) { mySqlScript += "'" + this.a_sGuidBaseSales_WorkReport_Categories + "',"; }
            if (this.a_sNameBaseSales_WorkReport_Categories != null) { mySqlScript += "'" + this.a_sNameBaseSales_WorkReport_Categories + "',"; }
            if (this.a_sTitle != null) { mySqlScript += "'" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sNameBaseApprovalProcess != null) { mySqlScript += "'" + this.a_sNameBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { mySqlScript += "'" + this.a_sApprovalStatus + "',"; }
            if (this.a_dStartDate != null) { mySqlScript += "'" + this.a_dStartDate + "',"; }
            if (this.a_dEndDate != null) { mySqlScript += "'" + this.a_dEndDate + "',"; }
            if (this.a_sContent != null) { mySqlScript += "'" + this.a_sContent + "',"; }
            if (this.a_sNeedHelpSolutionProblem != null) { mySqlScript += "'" + this.a_sNeedHelpSolutionProblem + "',"; }
            if (this.a_sCustomerReferContent != null) { mySqlScript += "'" + this.a_sCustomerReferContent + "',"; }
            if (this.a_sAdvertiseReferContent != null) { mySqlScript += "'" + this.a_sAdvertiseReferContent + "',"; }
            if (this.a_sLogName != null) { mySqlScript += "'" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkSales_WorkReport set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            if (this.a_dCreateDate != null) { iColumnCount++; mySqlScript += " dCreateDate = '" + this.a_dCreateDate + "',"; }
            if (this.a_sGuidBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sGuidBase_Department_Person_Operator = '" + this.a_sGuidBase_Department_Person_Operator + "',"; }
            if (this.a_sNameBase_Department_Person_Operator != null) { iColumnCount++; mySqlScript += " sNameBase_Department_Person_Operator = '" + this.a_sNameBase_Department_Person_Operator + "',"; }
            if (this.a_sNameInfoWorkReportCycleType != null) { iColumnCount++; mySqlScript += " sNameInfoWorkReportCycleType = '" + this.a_sNameInfoWorkReportCycleType + "',"; }
            if (this.a_sGuidBaseSales_WorkReport_Categories != null) { iColumnCount++; mySqlScript += " sGuidBaseSales_WorkReport_Categories = '" + this.a_sGuidBaseSales_WorkReport_Categories + "',"; }
            if (this.a_sNameBaseSales_WorkReport_Categories != null) { iColumnCount++; mySqlScript += " sNameBaseSales_WorkReport_Categories = '" + this.a_sNameBaseSales_WorkReport_Categories + "',"; }
            if (this.a_sTitle != null) { iColumnCount++; mySqlScript += " sTitle = '" + this.a_sTitle + "',"; }
            if (this.a_sGuidBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sGuidBaseApprovalProcess = '" + this.a_sGuidBaseApprovalProcess + "',"; }
            if (this.a_sNameBaseApprovalProcess != null) { iColumnCount++; mySqlScript += " sNameBaseApprovalProcess = '" + this.a_sNameBaseApprovalProcess + "',"; }
            if (this.a_sApprovalStatus != null) { iColumnCount++; mySqlScript += " sApprovalStatus = '" + this.a_sApprovalStatus + "',"; }
            if (this.a_dStartDate != null) { iColumnCount++; mySqlScript += " dStartDate = '" + this.a_dStartDate + "',"; }
            if (this.a_dEndDate != null) { iColumnCount++; mySqlScript += " dEndDate = '" + this.a_dEndDate + "',"; }
            if (this.a_sContent != null) { iColumnCount++; mySqlScript += " sContent = '" + this.a_sContent + "',"; }
            if (this.a_sNeedHelpSolutionProblem != null) { iColumnCount++; mySqlScript += " sNeedHelpSolutionProblem = '" + this.a_sNeedHelpSolutionProblem + "',"; }
            if (this.a_sCustomerReferContent != null) { iColumnCount++; mySqlScript += " sCustomerReferContent = '" + this.a_sCustomerReferContent + "',"; }
            if (this.a_sAdvertiseReferContent != null) { iColumnCount++; mySqlScript += " sAdvertiseReferContent = '" + this.a_sAdvertiseReferContent + "',"; }
            if (this.a_sLogName != null) { iColumnCount++; mySqlScript += " sLogName = '" + this.a_sLogName + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkSales_WorkReport Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //网上订单( WorkWeb_Order )  
    /// <summary>
    /// 网上订单
    /// </summary>
    public partial class Sql_WorkWeb_Order
    {
        #region 与数据表(网上订单)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkWeb_Order( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkWeb_Order set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkWeb_Order Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
    //网上订单刊期( WorkWeb_Order_Item )  
    /// <summary>
    /// 网上订单刊期
    /// </summary>
    public partial class Sql_WorkWeb_Order_Item
    {
        #region 与数据表(网上订单刊期)对应的字段属性
        /// <summary> 
        /// 唯一键 
        /// </summary> 
        public System.String a_sGuid = null;
        #endregion
        #region F_AvoidSqlAttack
        /// <summary>
        /// 根据需要的字段和设置的条件进行查询
        /// </summary>
        /// <param name="FieldString">字段列表 例如: sGuid,sName</param>
        /// <param name="WhereString">Where条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        private void F_AvoidSqlAttack()
        {
            if (this.a_sGuid != null) { this.a_sGuid = ReplaceString.GetReplaceString(this.a_sGuid); }
        }
        #endregion F_AvoidSqlAttack
        #region 插入记录
        /// <summary>
        /// 插入记录方法，返回脚本 
        /// </summary>
        public string F_InsertRecords()
        {
            F_AvoidSqlAttack();
            string mySqlScript = string.Empty;
            mySqlScript = " INSERT INTO  WorkWeb_Order_Item( ";
            if (this.a_sGuid != null) { mySqlScript += "sGuid,"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号
            mySqlScript += @" 
                                         )
                                        VALUES (
                                        ";
            if (this.a_sGuid != null) { mySqlScript += "'" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += @" 
                                         )
                                        "; return mySqlScript;
        }
        #endregion 插入记录
        #region 更新记录
        /// <summary>
        /// 根据设置的条件 更新记录
        /// </summary>
        /// <param name="WhereString">更新的条件 例如:  sGuid = 'aaa'</param>
        /// <returns></returns>
        public string F_UpdateRecords(string WhereString) //如果没有列被赋值 则返回空的字符串
        {
            F_AvoidSqlAttack();
            int iColumnCount = 0;
            string mySqlScript = string.Empty;
            mySqlScript = " UPDATE  WorkWeb_Order_Item set  ";
            if (this.a_sGuid != null) { iColumnCount++; mySqlScript += " sGuid = '" + this.a_sGuid + "',"; }
            mySqlScript = mySqlScript.Trim();
            mySqlScript = mySqlScript.Substring(0, mySqlScript.Length - 1);//去掉没有用的逗号 
            mySqlScript += " where  " + WhereString + " ";
            if (iColumnCount == 0) { return string.Empty; }
            return mySqlScript;
        }
        #endregion 更新记录
        #region 根据Guid更新记录
        /// <summary>
        /// 根据Guid更新记录
        /// </summary>
        /// <param name="sGuidString">Guid列的值</param>
        /// <returns></returns>
        public string F_UpdateRecordsByGuid(string sGuidString)
        {
            return F_UpdateRecords(" sGuid = '" + sGuidString + "' ");
        }
        #endregion 根据Guid更新记录
        #region 删除记录
        /// <summary>
        /// 根据设置的条件 删除记录
        /// </summary>
        /// <param name="WhereString">Where条件 例如: sGuid = 'aaa' </param>
        /// <returns></returns>
        public string F_DeleteRecords(string WhereString)
        {
            string mySqlScript = string.Empty;
            mySqlScript = " DELETE from  WorkWeb_Order_Item Where  " + WhereString + "  ";
            return mySqlScript;
        }
        #endregion 删除记录
    }
}
